Ko te hekenga raruraru e hautū ana i te Tukutuku, te whakaora i te aituā tūmau, me te whakahokinga pūrua¶
Ko te kore ohorere e hautū ana i te paetukutuku, te whakatārewatanga o te kaute, te korenga o nga taputapu o te pokapū raraunga, te whakararu i te haumarutanga o te tūmau ka taea te whakakore i te uru ki nga paetukutuku pakihi, nga utu e-tauhokohoko, nga tomokanga kaihoko, me nga purongo mamati. Ina tukinga nga tūmau manaaki tiritiri, ka taka nga kaitirotiro mariko, ka kati ranei nga kamupene manaaki i nga kaute i te wa o te nama nama, i nga tautohetohe rauemi ranei, ma te marama o nga tikanga heke ohorere ka tiakina to whakahaere mai i te ngaronga raraunga tuturu me te wa roa.
Ko te mahi i te hekenga o te tūmau ohorere i raro i te pehanga e hiahia ana ki te tarai tikanga. Ma te tango i nga whenua papaa raraunga me nga konae tono e ora ana, te whakarato i tetahi tūmau kapua motuhake, te whakaora i nga ripanga papaa raraunga me nga whakaaetanga konae, te whakahoki ano i nga rekoata a Domain Name System (DNS) me te iti o te whakaroa o te keteroki, me te tuku tiwhikete Haumarutanga Layer Transport (TLS) hou, ka taea e koe te whakahoki mai i nga mahinga tukutuku katoa i roto i te kotahi ki te rua haora.
Mahia tenei inaianei¶
Mena kei te heke to paetukutuku, tono paetukutuku ranei, kua whakatarewahia, kei te anga atu ranei ki te whakamutua te tūmau tata, whai i enei mahi pupuri me te tangohanga:
- Whakaarohia he aha te urunga whakahaere e mahi tonu ana: Whakamatauhia mena ka taea tonu e koe te toro atu ki to tuumau ma te SSH (Secure Shell), SFTP (SSH File Transfer Protocol), to paewhiri mana whakahaere (cPanel, Plesk, DirectAdmin, papatohu kapua ritenga ranei). Kaua e tuku tikiti tautoko riri e whakatuma ana i nga mahi ture i mua i to tango i o raraunga, na te mea ka akiakihia e nga tikiti riri i etahi wa nga kaihautu kino ki te whakakore i te urunga.
- ** Whakahohehia "I runga i te ipurangi i nga wa katoa" me te tiaki keteroki ki to tapa CDN**: Mena ka whakamahia e to rohe he takawaenga whakamuri mata penei i te Cloudflare, takiuru ki to papatohu DNS me te manatoko kei te kaha te mahi keteroki kia kite tonu nga manuhiri i nga wharangi pateko keteroki i a koe e hanga ana i te tūmau o muri.
- Whakahekea o uara DNS Time To Live (TTL) ki te 60 ki te 300 hēkona tonu: Mena kei te whakatau tonu to rohe, kei te mahi wahanga ranei, takiuru ki to rehita rohe, kaiwhakarato DNS ranei inaianei ka whakaitihia te TTL i runga i to
@(pakiaka),www, me te roherotoAaAAAAka tuhia ki te 300 hēkona (5 meneti) ki te 60 hēkona (1 meneti) na reira ka tere tere te tapahi wāhitau IP e haere ake nei ki te ao katoa. - Tangohia to papaunga raraunga SQL i te tuatahi: He iti noa nga konae raraunga (megabytes ki etahi gigabytes) kei roto i o raraunga hihiri e kore e taea te whakakapi (nga ota a nga kaihoko, nga kaute kaiwhakamahi, nga pou, me nga whakawhitinga). Rere
mysqldumpraneipg_dumprunga SSH, kaweake ranei a.sql.gzpūranga mā te phpMyAdmin, ka tikiake tonu ki tō rorohiko ā-rohe. - Kōpeke me te tango i to tono paetukutuku pakiaka me nga konae whirihoranga: Waihangahia he kotahi
.tar.gzranei.zippūranga o to pakiaka tuhinga (tae atu ki nga konae huna penei.enva.htaccess) ka tango mai i te tūmau mā SFTP raneirsync. - Whakamanahia te mana o to kaute kairēhita rohe: Whakaū ka taea e koe te takiuru ki te kairēhita rohe kei reira to ingoa rohe kua rehitatia (pērā i Cloudflare Registrar, Porkbun, Namecheap, AWS Route 53 ranei). Mena kua rehitatia to ingoa rohe na roto i te kamupene hautū tukutuku e kore e taka, wetewete te rohe me te tiki tonu i te EPP / Waehere Whakawhiti Whakamana.
Danger
I te wa e whakaputa ana a .zip ranei .tar.gz pūranga pūrua kei roto i te whaiaronga tukutuku tūmatanui ora (pērā i /var/www/html/backup.zip ranei public_html/site-backup.tar.gz), karapa haere tonu nga karetao kino ipurangi aunoa i nga rohe mo nga ingoa konae taapiri noa. Mena ka tangohia e te kaitukino to purongo, ka uru katoa ki o kupuhipa papaunga raraunga, ki nga taviri API, me nga rekoata a nga kaihoko. Tuhia i nga wa katoa nga putunga putunga ki tetahi raarangi motuhake kei waho o te pakiaka tukutuku whanui (penei i te /home/username/ ranei /tmp/) ka mukua nga puranga rangitahi mai i te tūmau ka mutu tonu to tango.
Tūtohi rerenga whakamatautau raru: te kowhiri i to ara whakaora¶
Whakamahia tenei rakau whakatau ki te whiriwhiri i te tikanga whakaora tere i runga i to urunga tūmau me to mana rohe:
flowchart TD
A["Paetukutuku, Tumau Tumau ranei kua kitea kua mate"] --> B{"Ka taea tonu e koe te uru atu ki te SSH, SFTP, cPanel ranei?"}
B -->|"Āe: Mahi Uru Ora"| C["Whakahaerehia te putunga raraunga ora 15-meneti me te puranga tar webroot"]
B -->|"Kao: Kua mate te Tūmau, kua maukatihia te kaute"| D{"Kei a koe he taapiri i waho-pae, he papatohu whakaora ranei?"}
D -->|"Kei te waatea te Aratau Whakaora VPS"| E["Whakaorangia te hiipoata Whakaoranga ISO, whakairihia te kōpae, me te raraunga SCP ki waho"]
D -->|"Pūrua o waho anake"| F["Tikina te SQL hou me te whakaahua whakaahua mai i te S3 / Backblaze / rokiroki rohe"]
C --> G{"Na te kino kino, te hacking ranei te mate?"}
E --> G
F --> G
G -->|"Kao: Nga taputapu, te nama nama, te rahunga kaihautu ranei"| H["Whakaratohia he VPS ma, he kaihautu whakahaere ranei, ka whakahoki tika i te purongo"]
G -->|"Ae: Ransomware, webshell taupatupatu ranei"| I["Ko te taapiri taratahi, toha CMS/waehere hou mai i Git, horoi i nga tukunga me te SQL"]
H --> J["Whakamatau ma te konae kaihautu o te rohe, tukuna he tiwhikete TLS, ka tapahia nga rekoata DNS A/AAAA"]
I --> J
Wāhanga 1: Te kawa tangohanga raraunga ohorere 15 meneti¶
Ki te kore e u te tūmau, ka taka i raro i te paheketanga o te pūmārō, kei te tata whakatārewahia ranei, tangohia o raraunga i runga i te raupapa o te kaupapa matua: ko nga raraunga tuatahi, ko nga konae whirihoranga tuarua, ko te waehere me nga kaupapa tuatoru, me te tukunga ake o nga panui pateko te whakamutunga.
Tikanga A: Tangohanga raina-whakahau ma te SSH (tere me te tino pono)¶
Ko nga kaiwhakahaere o nga konae ipurangi me nga tango tirotiro tirotiro he maha nga wa ka pau, ka kino ranei nga puranga i te kaweake i nga waahi nui ake i te 500 megabytes. Mēnā kei a koe te urunga kāpeka SSH, whakahaeretia ēnei whakahau hei hanga i ngā whakaahua kōpeke riterite:
# 1. Create a private working directory outside the public webroot:
mkdir -p ~/emergency_migration && chmod 700 ~/emergency_migration
# 2. Dump MySQL / MariaDB database with single-transaction consistency (no table locking on InnoDB):
mysqldump --single-transaction --routines --triggers --events \
-u db_username -p db_name | gzip -9 > ~/emergency_migration/db_backup_$(date +%F).sql.gz
# (Alternative for PostgreSQL databases):
# pg_dump -U db_username -Fc db_name > ~/emergency_migration/db_backup_$(date +%F).dump
# 3. Archive the entire webroot, preserving permissions and hidden dotfiles (.env, .htaccess):
tar -czpf ~/emergency_migration/webroot_backup_$(date +%F).tar.gz -C /var/www/html .
# 4. Copy existing Nginx/Apache virtual host configs and cron jobs for reference:
cp -r /etc/nginx/sites-available ~/emergency_migration/nginx_configs 2>/dev/null
crontab -l > ~/emergency_migration/user_crontab.txt 2>/dev/null
Kia hangahia nga purongo ki runga i te tūmau mamao, whakatuwherahia he tauranga ki to teihana mahi o to rohe (me te tika ranei i runga i to tuumau kua tohua) ka toia nga konae ki te whakamahi. rsync ranei scp:
# Pull the backups to your local computer with resume support (-P) if the connection drops:
rsync -avzP -e "ssh -p 22" username@old_server_ip:~/emergency_migration/ ./local_rescue_folder/
Tikanga B: Te tango raraunga mai i te VPS unbootable ma te whakamahi i te Aratau Whakaora¶
Ki te kore to Tumau Tūmataiti Mariko (VPS) me te tūmau i whakatapua ki te puhipuhi (hei tauira, na te kino o te kakano Linux, te GRUB bootloader kua pakaru, te wehenga pakiaka katoa ranei) me te SSH kaore e whakautu, kaua e muru, e whakaahua ano ranei i te tūmau:
- Takiuru ki te paewhiri mana taputapu o to kaiwhakarato kapua (DigitalOcean, Hetzner, Linode/Akamai, Vultr, OVHcloud, AWS EC2 ranei).
- Whakahohehia ** Aratau Whakaoranga** (whakapirihia ranei te rōrahi pakiaka ki tetahi tauira whakaora rangitahi) ka whakaara ano i te tūmau ki te taiao whakaora Linux ora.
- Hono atu ki te taiao whakaora ma te SSH, te papatohu VNC-a-tirotiro ranei, whakairihia te waahanga rokiroki tuatahi o to kaimau, ka kape i o konae ki waho:
# Identify your main storage partition (usually /dev/sda1, /dev/vda1, or /dev/nvme0n1p1):
lsblk
# Mount the partition read-only (or read-write if needed) to /mnt/rescue:
mkdir -p /mnt/rescue
mount -o ro /dev/vda1 /mnt/rescue
# Archive your web files and raw MySQL/MariaDB data directory (/var/lib/mysql):
tar -czpf /tmp/raw_mysql_files.tar.gz -C /mnt/rescue/var/lib/mysql .
tar -czpf /tmp/site_files.tar.gz -C /mnt/rescue/var/www/html .
Tikanga C: Tirihia te tangohanga paewhiri mana whakahaere (cPanel, Plesk, DirectAdmin)¶
Mena kei runga koe i te manaaki tiri me te kore uru SSH:
- ** Hangaia he Pūrua cPanel Katoa**: I roto i te cPanel, whakatuwheratia Backup or ** Ruānuku Pūrua** ka paato i te Tikiake he Pūkete Pūkete Katoa. Ma tenei ka hanga kotahi
backup-date_time_username.tar.gzhe konae kei roto i to raarangi kaainga kei roto i o konae whanui, papaa raraunga MySQL, tuku imeera, me nga rekoata rohe DNS, ka taea te whakahoki mai ma te paato kotahi i runga i tetahi atu kaihautu cPanel, ka wetewetehia ranei i runga i tetahi VPS Linux. - Whakaputaina raraunga phpMyAdmin a-ringa: Mena kua monoa e to kaihautu te taputapu taapiri katoa, whakatuwheratia phpMyAdmin, tohua to paataka korero ki te taha maui, pawhiria ** Kaweake** kei runga, tohua ** Ritenga**, tohuhia nga ripanga katoa, tirohia Add DROP TABLE / VIEW / PROCEDURE / FUNCTION, whiriwhiria Gzipped
- Puranga Kaiwhakahaere Kōnae: Whakatuwheratia Kaiwhakahaere Kōnae, pawhiria Tautuhinga kei te kokonga matau o runga ka tirohia Whakaatuhia nga Kōnae Huna (dotfiles) kia kore koe e ngaro
.htaccessranei.env. Tīpakohia ngā kōnae katoa o rotopublic_html/, pāwhiritia Kōpeke (Zip ArchiveraneiGZiped Tar Archive), tikiakehia te pūranga ki tō rorohiko, ka muku tonu i te kōnae pūranga mai i te tūmau.
Phase 2: Provisioning independent target infrastructure¶
Kaua rawa e heke mai i tetahi waitohu manaaki tiritiri ki tetahi atu waitohu na te roopu matua kotahi ano e whakamahi ana i nga hanganga pokapū raraunga. Kōwhiria he kaiwhakarato rorohiko motuhake, he papa whakahaere ranei me te purongo mana marama me te kaha hopu whakaahua aunoa.
Whakatauritenga o nga hoahoanga whaainga hekenga ohorere¶
| Target Hosting Type | Tere Whakarato | Technical Skill Required | Best Use Case During an Emergency |
|---|---|---|---|
| Cloud VPS Instance (DigitalOcean, Linode/Akamai, Hetzner, Vultr, AWS Lightsail) | 60 seconds | CLI Linux Takawaenga (SSH, Nginx/Apache, MariaDB) | Full root control, lowest cost, immune to shared hosting resource throttling, ideal for custom apps or high-traffic CMS sites. |
| Managed Cloud Control Panel (Cloudways, RunCloud, Forge, Ploi, SpinupWP on VPS) | 5 to 10 minutes | Beginner to Intermediate | Automated LEMP stack provisioning, built-in SSL, firewall, and staging environments without manual command-line server setup. |
| Independent cPanel / Plesk Host | 10 to 20 minutes | Beginner | Fastest drop-in restoration if you extracted a full cpanel-backup.tar.gz archive and need bundled POP3/IMAP email hosting. |
| Static / Jamstack Edge Hosting (Cloudflare Pages, GitHub Pages, Netlify, Vercel) | 2 to 5 minutes | Intermediate (Git workflow) | Ideal for static sites (Zensical, MkDocs, Hugo, Astro, Next.js) or placing a static emergency landing page online instantly. |
Provisioning a clean Ubuntu 24.04 LTS LEMP stack (Nginx + MariaDB + PHP)¶
If you spin up a clean Ubuntu 24.04 LTS cloud server, run this commands sequence as root or a sudo user to build a production-ready web server in under 5 minutes:
# 1. Update operating system packages and install core utilities:
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl wget git unzip ufw fail2ban
# 2. Configure the Uncomplicated Firewall (UFW) before exposing services:
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw --force enable
# 3. Install Nginx web server and MariaDB database server:
sudo apt install -y nginx mariadb-server
# 4. Install PHP-FPM and standard web application extensions:
sudo apt install -y php8.3-fpm php8.3-mysql php8.3-curl php8.3-gd \
php8.3-mbstring php8.3-xml php8.3-zip php8.3-intl php8.3-bcmath \
php8.3-imagick php8.3-redis
# 5. Enable and start all core services on boot:
sudo systemctl enable --now nginx mariadb php8.3-fpm
Warning
Always double-check what PHP, Node.js, Python, or database version your legacy website requires before switching traffic. If you migrate an older PHP 7.4 application onto a brand-new PHP 8.3 server without testing, deprecated functions in older plugins or custom code may trigger fatal HTTP 500 Internal Server Error crashes. If needed, you can run exact legacy PHP versions side-by-side on Ubuntu using the trusted ppa:ondrej/php repository until your code is updated.
Phase 3: Restoring the database, unpacking files, and hardening permissions¶
Once your new server is running, transfer your backup archives to the new server via scp ranei rsync and restore the database and document root.
1. Creating an isolated database user and importing the SQL dump¶
Kaua rawa e honoa he tono tukutuku whakangao ki te patengi raraunga ma te whakamahi i te root pūkete MySQL. Waihangahia he papaa raraunga kua whakatapua me tetahi kaiwhakamahi papaaarangi whai mana nui e herea ana localhost:
I roto i te tere SQL, whakahaere:
CREATE DATABASE prod_app_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'prod_app_user'@'localhost' IDENTIFIED BY 'Generate_A_Strong_32_Char_Random_Password';
GRANT ALL PRIVILEGES ON prod_app_db.* TO 'prod_app_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Now stream your compressed .sql.gz tārua tika ki te pātengi raraunga hou i hangaia mai i te raina whakahau Linux:
# Stream and decompress the SQL backup into MariaDB:
zcat ~/db_backup_2026-10-30.sql.gz | sudo mysql -u root prod_app_db
2. Te wetewete i nga konae tono me te whakarite i nga whakaaetanga POSIX tino¶
Incorrect file ownership or overly permissive 777 permissions are major causes of both broken migrations (403 Forbidden or failed image uploads) and secondary security breaches:
# Create the target webroot directory and unpack your archive into it:
sudo mkdir -p /var/www/yourdomain.com
sudo tar -xzpf ~/webroot_backup_2026-10-30.tar.gz -C /var/www/yourdomain.com
# Assign ownership to the web server daemon (www-data on Ubuntu/Debian):
sudo chown -R www-data:www-data /var/www/yourdomain.com
# Set all directories to 755 (rwxr-xr-x) and all files to 644 (rw-r--r--):
sudo find /var/www/yourdomain.com -type d -exec chmod 755 {} +
sudo find /var/www/yourdomain.com -type f -exec chmod 644 {} +
# Lock down sensitive configuration files containing database credentials:
sudo chmod 600 /var/www/yourdomain.com/wp-config.php 2>/dev/null
sudo chmod 600 /var/www/yourdomain.com/.env 2>/dev/null
3. Updating database credentials and environment variables¶
Open your application's configuration file (for example, wp-config.php for WordPress, .env for Laravel/Node/Django, sites/default/settings.php for Drupal, or app/etc/env.php for Magento) and update:
- Database Name (
DB_NAME):prod_app_db - Database User (
DB_USER):prod_app_user - Database Password (
DB_PASSWORD): Your newly generated random password - Database Host (
DB_HOST):localhostranei127.0.0.1(remember that many managed hosts use external RDS or remote MySQL hostnames; when moving to a self-contained VPS, this must be changed back tolocalhost).
Phase 4: Local hosts file testing before switching public DNS¶
Never point your live public DNS records to a newly migrated server before verifying that the site actually loads, connects to the database, and renders internal links properly. You can test the new server privately on your own computer while the rest of the world still sees your old DNS settings by editing your local hosts file.
- Locate your local
hostsfile:- Linux and macOS: Open a terminal and run
sudo nano /etc/hosts. - Windows 10 / 11: Open Notepad as Administrator and open
C:\Windows\System32\drivers\etc\hosts.
- Linux and macOS: Open a terminal and run
- Add a temporary override line at the bottom of the file: Replace
203.0.113.50with your new server's IPv4 address: - Save the file and test in a private browser window: Your computer will now bypass public DNS and load
yourdomain.comdirectly from the new server IP. Test the home page, internal article permalinks (if subpages return404 Not Foundon Nginx, make sure your Nginx server block includestry_files $uri $uri/ /index.php?$args;), customer login forms, and shopping cart checkouts. - Remove the line from
/etc/hostsonce testing succeeds: Do not forget to delete the temporary override line from your localhostsfile before performing the real public DNS cutover.
Phase 5: DNS cutover, TTL bypass strategies, and SSL/TLS certificates¶
Once local testing confirms the new server works properly, execute the public DNS cutover and provision HTTPS encryption.
Ko nga rekoata DNS nui hei tirotiro i te wa o te tapahi¶
| Momo Rekoata | Kaihautū / Ingoa | Target Value | Purpose & Migration Action |
|---|---|---|---|
| A Record | @ (Root domain) |
New Server IPv4 (e.g., 203.0.113.50) |
Routes main IPv4 web traffic to your new server. Update immediately at cutover. |
| AAAA Record | @ (Root domain) |
New Server IPv6 (e.g., 2001:db8::1) |
Routes IPv6 traffic. Important: If your new server does not have IPv6 configured, delete the old AAAA record or half your visitors will still hit the dead server. |
| CNAME / A | www |
yourdomain.com (or New IPv4) |
Routes www subdomain traffic. Keep synced with the root record. |
| MX Records | @ |
Mail server hostnames (e.g., Google, Microsoft) | Ko nga huarahi e uru ana ki te imeera a te kamupene. Kia mau tonu kia kore e pakaru nga imeera umanga. |
| TXT (SPF) | @ |
v=spf1 ip4:NEW_IP include:... ~all |
Ka whakamanahia to IP tūmau hou ki te tuku imeera tauwhitinga me te kore e u ki roto i te mokowhiti. |
| CAA Record | @ |
0 issue "letsencrypt.org" |
Ko nga rekoata whiriwhiri e aukati ana ko te Mana Tiwhikete ka taea te tuku tiwhikete SSL. Manatokohia ka taea te Whakamuna. |
Me pehea te karo i te keteroki TTL DNS 24-haora (86,400-hekona) kua mau¶
Mena i pakaru ohorere to kaihautu tukutuku tawhito i te wa roa o to rekoata DNS mo te Ora (TTL) 14,400 hēkona (4 haora) 86,400 hēkona (24 haora), whakatika noa i te A Ko te rekoata i roto i te rohe DNS tawhito ko te tikanga ka tukuna tonu e nga kaiwhakatikatika ISP te ao ki te tuku manuhiri ki te wahitau IP kua mate kia pau ra ano taua taima.
- Ko te Tiaki Tiaki Tiaki Ingoa Whaimana: Mena i whakahaerehia to DNS ki nga ingoa ingoa o te kaihautu tukutuku kua mate, takiuru ki to kairēhita rohe ka huri i to rohe Toumau Ingoa Mana (NS) ki te whatunga DNS anycast motuhake, tere-tere (pērā i Cloudflare DNS, AWS Route 53) i kawemai ai koe i to rohenga DNS hou e tohu ana. Ko nga whakahōutanga ingoa ingoa rehita o runga-Taumata (TLD) ka pana tonu ki nga tuunga pakiaka o te ao, me te karo i nga keteroki rekoata-a-tamariki kua mate puta noa i nga kaiwhakatikatika recursive nui (penei i te
1.1.1.1a8.8.8.8). - Whakamuri Takawaenga Whakahoki Whakamua mai i te Tūmau Tawhito: Mena kei te waatea tonu to tūmau tawhito ma te SSH (hei tauira, i te wa o te hekenga nama, te whakakorenga taputapu ranei) ka hiahia koe ki te tuhi i te papaaarangi-rorohiko kore i te wa e hora ana a DNS mo nga haora 24, whakauruhia he paraka takawaenga whakamuri Nginx mama ranei
socatte kauhanga i runga i te tūmau tawhito e takai ana i te 100 paihēneti o nga tono HTTP/HTTPS taumai ki runga ki te wahitau IP o te tūmau hou. Ma tera ara, ko nga manuhiri kua keteroki e te ISP te wahitau IP tawhito ka tukuna ora mai i te papaunga raraunga tūmau hou.
Te whakarato tiwhikete SSL/TLS aunoa koreutu (Certbot / Kia Whakamuna)¶
I te wa e tohu ana to DNS whanui ki te tūmau hou (ma te whakamanatanga API DNS-01 ranei i mua i te huri i te DNS), whakauruhia he tiwhikete HTTPS pono kia kore ai nga manuhiri e tutaki ki nga whakatupato haumarutanga tirotiro:
# Install Certbot and the Nginx configuration plugin:
sudo apt install -y certbot python3-certbot-nginx
# Issue the certificate and configure automatic HTTP-to-HTTPS 301 redirects:
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com \
--non-interactive --agree-tos -m admin@yourdomain.com --redirect
# Verify the systemd auto-renewal timer is active:
sudo systemctl status certbot.timer
Note
Ka whakamanahia e te Whakamuna nga tepe reiti whakangao (tae atu ki te 5 tiwhikete taarua mo ia huinga rohe mo ia 7 ra, me te 50 tiwhikete mo ia rohe kua rehita ia wiki). Mena kei te whakamatautau koe i to tuhinga tuhi tūmau, tukuna i nga wa katoa --staging haki ki certbot until your setup works, then run certbot once without --staging to fetch your live production certificate.
Wāhanga 6: Te tiaki i te haere tonu o nga imeera umanga (MX, SPF, DKIM, DMARC)¶
One of the most damaging side effects of a rushed website migration occurs when an administrator switches the domain's nameservers to a new host without copying over the domain's Mail Exchanger (MX) and authentication TXT records, silently blackholing all incoming company emails.
- Export your full DNS zone before changing nameservers: Before changing nameservers at your registrar, copy every existing
MX,TXT,SRV, aCNAMEtuhi mai i to papatohu DNS o naianei. - Wehewehea te manaaki imeera mai i te manaaki tukutuku: Kaua rawa e manaaki i nga imeera pakihi miihana-nui i runga i te tūmau cPanel rohe rite ki to paetukutuku whanui. Whakamahia he kaiwhakarato imeera kua whakatapua (penei i a Google Workspace, Microsoft 365, Fastmail, Proton Mail, Zoho Mail ranei) kia kore rawa te tukinga o te tūmau tukutuku e haukotia i nga korero a te kamupene.
- Whakahouhia to rekoata SPF me te IP tūmau hou: Mena ka tukuna e to paetukutuku nga imeera tautuhi kupuhipa, whakamohiotanga puka whakapā, me nga rihīti ota WooCommerce mai i te tūmau, whakakapihia te IP tūmau tawhito me te IP tūmau hou kei roto
v=spf1Rekoata TXT, araia ranei nga imeera puta noa i te paetukutuku ma te ratonga API SMTP tauwhitinga motuhake (pērā i te Tohu Pouaka, Amazon SES, SendGrid, Mailgun ranei) me te hainatanga DKIM kua whakahohea.
Wāhanga 7: Hekenga taratahi i muri i te whakaraeraetanga kino, ransomware ranei¶
Mena kei te heke koe i to paetukutuku na te mea i whakatarewahia e te kaihautu tawhito to putea mo te kino, werohanga hītinihanga, tuku mokowhiti, he takahi anga tukutuku ranei, kaua e kape me te wetewete i nga mea tawhito katoa. public_html pūranga ki tō tūmau hōu. Ma te mahi pera ka kape tika i te tatau o muri o te kaiwhai ki runga i to tūmau hou.
A pee i tenei rerenga mahi whakakino rūma ma:
- Tohaina nga konae tono matua hou mai i nga puna mana: Tangohia he kape hou, kare ano i pa o to CMS, anga anga ranei (hei tauira, tango tika mai i te putanga WordPress ma
wordpress.org, ki te kapohia ranei he commit ma kua manatoko mai i to putunga Git) me te whakauru i nga kape hou o nga monomai me nga kaupapa katoa mai i nga putunga whaimana, kaua ki te kape i te tawhito.wp-admin,wp-includes, raneivendorkōpaki. - Topihia nga papaahoa kaiwhakamahi pateko anake ka tango i nga tuhinga huna ka taea te kawe: Huna tonu nga kaipatu i nga anga tukutuku PHP e huna ana ki roto i nga kōpaki tuku whakaahua (pērā i
wp-content/uploads/2026/05/avatar.jpg.phpranei.iconga konae kei roto te waehere PHP). Tāruahia anake to kōpaki tukuake pāpāho ki roto i te whaiaronga taratahi ka purea nga tuhinga katoa ka taea te whakahaere i mua i te nuku ki to pakiaka tukutuku ora:# Delete any PHP, Python, Perl, or shell scripts hiding inside the uploads directory: sudo find /var/www/yourdomain.com/wp-content/uploads -type f \ \( -iname "*.php*" -o -iname "*.phtml" -o -iname "*.phar" -o -iname "*.py" -o -iname "*.sh" -o -iname "*.cgi" -o -iname ".htaccess" \) \ -exec rm -vf {} + - ** Monokia te mahi PHP i roto i te kōpaki tukuake i te taumata Nginx/Apache**: Tāpirihia he paraka tauwāhi i roto i to whirihora kaihautu mariko Nginx ka aukati i tetahi
.phpkōnae ki roto/uploads/mai i te mahia e PHP-FPM: - Tirotirohia te putunga raraunga SQL mo nga kaiwhakamahi JavaScript kua werohia me nga kaiwhakamahi nauhea: I mua i te kawemai i to papaunga raraunga, matawai i te
.sqlkōnae mo te werohia<script>tohu,eval(base64_decode(...))nga utu utu, ka tirohia ngauserstepu (wp_usersi roto i te WordPress) ki te whakakore i nga kaute kaiwhakahaere tauhou i hangaia e te kaipatu. Hurihia ia kupuhipa pātengi raraunga, kī tote haumarutanga CMS, me te tohu API tonu.
Te hanga i te oranga mo te wa roa: te hoahoanga taapiri 3-2-1-1-0¶
Kia hoki mai to paetukutuku ki te ipurangi me te pumau, whirihorahia he paipa whakamuna, kua whakamunatia ki waho-pae kia kore ai koe e pa ki tetahi waahi o te rahua:
- 3 kape o o raraunga: Ko to kaimau whakangao ora me nga kape taapiri motuhake e rua.
- 2 momo whakatakotoranga rokiroki rereke: Ko nga whakaahua paraka tere tere i te taha o nga putunga taumata tono kawe (
.sql.gz+.tar.gz). - 1 te waahi kapua kei waho i te waahi kei runga i tetahi kaiwhakarato motuhake: Kaua rawa e penapena i o taapiri anake ki runga i nga tuunga o te kamupene manaaki. Whakamahi
resticraneiborgbackupmā te mahi cron ia rā ki te pana whakamuna, tango tārua ki te peere rokiroki ahanoa motuhake (pērā i te AWS S3, Backblaze B2, Cloudflare R2, Wasabi ranei). - 1 kape kore huri (apiri-anake / Maukati Ahanoa): Whirihorahia te Maukati Ahanoa S3 me te tuhi-anake ranei nga taviri API kia ahakoa ka whiwhi te kaitukino i te urunga SSH pakiaka ki to tuumau tukutuku, kaore e taea e ratou te muku, te whakamuna ranei i o taapiri o mua o te waahi.
- 0 ngā pūrua kāore i manatokona: Whakamātautauhia te whakahoki i tō pūranga pūrua ki tētahi taiao whakaari i te iti rawa kia kotahi hauwhā ki te whakaū kua oti o putunga SQL me te kore wahangu.
Pātai auau¶
How can I migrate my website if my old web host suspended my account and locked me out of cPanel and SSH?
First, check if you have any local backups, developer staging copies, or third-party backup plugin archives stored in Google Drive, Dropbox, or Amazon S3. If your only copy of the site is inside the suspended hosting account, contact the host's Abuse or Billing Compliance department calmly in writing and request a one-time generation of a downloadable backup archive (`cpmove` or `.tar.gz` of your files and SQL database) strictly for off-boarding purposes, offering to settle any undisputed past-due balance if billing was the cause. If the site was mostly informational and the host refuses all access, you can also extract your historical HTML pages, text, and images from the Internet Archive Wayback Machine (`web.archive.org`) using open-source Wayback downloader tools.
Why is my website showing a 500 Internal Server Error or Error Establishing a Database Connection after migrating?
An "Error Establishing a Database Connection" means the database name, username, password, or host address inside your configuration file (`wp-config.php` or `.env`) does not match the user you created in MySQL/MariaDB on the new server, or the `mariadb` service is stopped. A generic `500 Internal Server Error` or blank white screen usually stems from one of three causes: incorrect file ownership (fix with `chown -R www-data:www-data`), a syntax error in `.htaccess`, or a PHP version mismatch where an old plugin crashes on PHP 8.2/8.3. Check the exact error message by running `sudo tail -n 50 /var/log/nginx/error.log` or `/var/log/php8.3-fpm.log`.
Why does my home page work on the new server, but every internal page returns a 404 Not Found error?
When migrating a CMS like WordPress, Laravel, or Drupal from an Apache server (which uses `.htaccess` files for URL rewriting) to an Nginx server (which ignores `.htaccess` files completely), internal permalinks will return `404 Not Found` unless you add a rewrite rule inside your Nginx site configuration block. Open `/etc/nginx/sites-available/yourdomain.com`, locate the `location /` block, make sure it contains `try_files $uri $uri/ /index.php?$args;`, and reload Nginx with `sudo systemctl reload nginx`.
How do I prevent losing new WooCommerce orders or user comments while DNS is propagating to the new server?
To achieve a zero-data-loss migration for dynamic e-commerce or membership sites, place the site into brief "Maintenance Mode" on the old server (blocking new checkout submissions for 10 to 15 minutes) right before taking your final `mysqldump`, import that final SQL dump onto the new server, and then immediately switch your DNS `A`/`AAAA` records (or flip the IP inside your Cloudflare proxy dashboard, which cuts traffic over globally within 30 seconds). You can also configure Nginx on the old server to reverse-proxy requests to the new server IP so visitors with stale DNS caches still interact with the new database.
What should I do if my domain name itself is registered with the failing web hosting company?
Separate your domain registration from your web hosting immediately. However, if your site is currently down, do not start an ICANN Registrar Transfer first, because transferring a domain between registrars takes up to 5 to 7 days and locks your nameservers during the transfer window. Instead, first log into the current registrar panel and change the **Nameservers (NS)** to an independent DNS provider (like Cloudflare or Route 53) to get your website back online today. Once your website is stable on the new server, unlock the domain, get the EPP Auth Code, and transfer the domain registration to an independent registrar.
Why are some visitors seeing my new server while others still see the old broken server hours later?
This is called DNS propagation delay, caused by two factors: the Time To Live (TTL) caching setting that was on your old DNS records before you changed them, and forgotten IPv6 (`AAAA`) records. Many mobile carriers (such as T-Mobile, Verizon, EE, and Telstra) route smartphone traffic preferentially over IPv6. If you updated your IPv4 `A` record to point to the new server, but forgot to update or delete the old IPv6 `AAAA` record, desktop users on Wi-Fi will see your new working site while mobile phone users on 5G will continue hitting the dead server via IPv6.
Kua tirohia nga puna¶
- National Institute of Standards and Technology (NIST, United States): Special Publication 800-34 Rev. 1, Contingency Planning Guide for Federal Information Systems and Server Recovery (
csrc.nist.gov). - Te Tiaki Haumaru Haumaru me te Hanganga Hanganga (CISA, United States): Nga Aratohu Whakanuia Te Raarangi mo te Haumarutanga Kapua, Haumarutanga DNS, me te Whakaora Ransomware mai i nga Pūrua (
cisa.gov). - National Cyber Security Center (NCSC, United Kingdom): Tuimotu me te Arahi Tautoko Tautoko, Haumarutanga Tukutuku Tukutuku, me te Whakaaetanga Papanga Waka (TLS) Nga Mahi Pai (
ncsc.gov.uk). - Te Ope Mahi Hangarau Ipurangi (IETF, Ao): RFC 1034 / RFC 1035 (Keteroki Pūnaha Ingoa Rohe me nga Whakatakotoranga TTL) me te RFC 8555 (ACME Automated Certificate Management Protocol) (
ietf.org). - Kaporeihana Ipurangi mo nga Ingoa Kua Whakaritea me nga Nama (ICANN, Ao): Kaupapahere mo te Whakawhitinga Rehitatanga i waenga i nga Kai-Rehita me nga Tika Kai-Rehita (
icann.org). - Tuwhera Kaupapa Haumarutanga Taupānga Tukutuku (OWASP, Ao): Whakapakeke Tūmau, Whakakore Tukunga Kōnae, me nga Rau Tinihanga Haumarutanga Raraunga Raraunga (
owasp.org).