
As a rule, rankings drop after a move not because of the new server, but because the site on it has become slightly different: a URL has disappeared, an error comes back instead of a page, a title is gone, or everything is closed to search crawlers. So there is one rule: before switching the domain, prove that the new server returns the same thing as the old one. Below is a WordPress site move from one VPS to another: command output from real servers and two traps we reproduced in a test. Moving from shared hosting through a control panel is not covered here: you need a VPS with root access.
What a search engine sees on your site and what you must not change
A search crawler visits specific URLs and records what each one returns: the response code (200 means the page exists, 404 means it does not, 500 means the server broke), the page title, the text, and the canonical URL (the one the site itself names as the “main” address for that page). After the move it will come to the same URLs. If everything on each of them is as before, then as far as the crawler is concerned nothing has happened except a change of IP address.
The causes of lost rankings in a move are usually simple:
- some URLs return 404 after the move (most often because of web server settings);
- the site returns 500 because of the database while you are “just finishing a few things”;
- the new server still has “do not index” mode on, or a restrictive
robots.txt; - HTTPS is gone, or the certificate was issued for a different name;
- the URLs changed (a different domain or link structure) without 301 redirects.
All five can be checked in advance. Now, step by step. The test setup: the “old host” is a server with WordPress (four posts and three pages: “About the shop”, “Delivery” and the standard Sample Page), the “new” one is a Weasel VPS with a clean Ubuntu 24.04. The IP address 203.0.113.10 in the commands below is a placeholder: for your own site, use the address of your new server. The site’s domain is made up, shop.lab.test: it is not in the real DNS, so until the “switch” we reach the servers by IP address and supply the right Host header. You will do the same with your own site.
Step 1. Take a baseline of the old site
Before touching anything, record what the site looks like now. We need a list of all important URLs: the home page, sections, articles, the sitemap and robots.txt. The list of URLs comes from the sitemap (sitemap.xml) or from the search console report on indexed pages. Here there are twelve URLs, and one of them certainly does not exist, to make sure that “page not found” stays a real 404 error and not an empty page with a 200 code.
The snap.sh script requests each URL with curl and prints the response code, title, canonical URL, redirect and size. The Host: shop.lab.test header inside the script tells the server which site we want, even though we connect by IP: so the same script can be pointed at both the old and the new server and the results compared.
#!/bin/bash
# snap.sh <base-url>
BASE="$1"
PATHS="/ /about/ /delivery/ /kak-zavarivat-chaj-1/ /kak-zavarivat-chaj-2/ /kak-zavarivat-chaj-3/ /hello-world/ /sample-page/ /?p=4 /wp-sitemap.xml /robots.txt /net-takoj-stranicy/"
for p in $PATHS; do
out=$(curl -s -o /tmp/_snap_body -w '%{http_code}|%{redirect_url}|%{size_download}' -H "Host: shop.lab.test" "$BASE$p")
code=$(echo "$out" | cut -d'|' -f1)
redir=$(echo "$out" | cut -d'|' -f2)
bytes=$(echo "$out" | cut -d'|' -f3)
title=$(grep -o '<title>[^<]*' /tmp/_snap_body | head -1 | sed 's/<title>//')
canon=$(grep -o 'rel="canonical" href="[^"]*' /tmp/_snap_body | head -1 | sed 's/.*href="//')
printf '%-26s %s | title=%s | canonical=%s | redir=%s | bytes=%s\n' "$p" "$code" "$title" "$canon" "$redir" "$bytes"
doneReplace the PATHS list with the URLs of your site. Run it:

For brevity, nine of the twelve lines are shown: the other three (/kak-zavarivat-chaj-2/, /kak-zavarivat-chaj-3/ and /sample-page/) look the same. The titles contain the text –: this is a dash as WordPress outputs it in HTML. The test site is in Russian, so its page titles are translated in the listing. What matters here: the pages have a title and a canonical URL, the short URL /?p=4 redirects (301) to the pretty one, and a nonexistent page answers 404. Save the output to a file: this is your baseline to compare the new server against.
For your own site, also note: which PHP version and extensions are needed, where the files live, which scheduled jobs (cron) exist, the redirect settings, and everything stored outside the site folder: mail, separate databases, certificates.
Step 2. In advance: lower the TTL
TTL is the time other servers remember your server’s address for. While it is long (hours), after an IP change some visitors and crawlers will keep landing on the old server for a long time. So, no later than the old TTL before the move, set the minimum TTL your DNS provider allows on the A records (and AAAA, if present) in the domain’s DNS zone. We did not touch DNS in the test because our domain is made up, so we cannot show output: where exactly this is configured depends on who hosts your DNS. For more on pointing a domain at a Weasel server, see the article “Pointing a domain at your VPS: DNS records and HTTPS”.
Step 3. Prepare the new server
On the clean VPS we install the same things that ran on the old one: a web server, PHP and a database. For WordPress, nginx, PHP-FPM and MariaDB are enough. If your old server runs PHP 8.1 and the new one gets 8.3, check that your plugins and theme support it before the move, not after.

The commands of this step run on the new server. The package list is for WordPress; for another engine it will differ: nginx is the web server, php-fpm and the php-* extensions run the WordPress code, mariadb-server stores the database, rsync is needed for copying, unzip and curl are helper utilities. The bottom three lines show the versions that were installed: these are what you should compare with the old server.
Step 4. Dump the database and copy the files
A site has two parts. Files: the engine itself, the theme, plugins and uploaded images. The database: the text of posts, settings, comments. You must move both, and as close together in time as possible. You run the dump and the copy on the old server.
The database is dumped into a single file with the .sql extension. The --single-transaction option makes the dump consistent without locking the site (for InnoDB tables, which is the WordPress default), and --default-character-set=utf8mb4 keeps non-Latin characters and emoji intact, with no garbled text. A password on the command line stays in the shell history; on a server where other people work, it is better to put it in the ~/.my.cnf file and remove -p from the command.

Files are copied with rsync: it can copy only what has changed. The -a option preserves file permissions and dates, -z compresses data in transit, --stats prints the final statistics. Here html/ is the site folder on the old server and /var/www/shop.lab.test/ is the folder on the new one. The slash after html/ means “the contents of the folder”, not the folder itself; this matters, otherwise the site ends up in a nested folder (we covered this in the article on scp and rsync).

Over three thousand files is an ordinary fresh WordPress install, 76 MB. A live site with images will have more, and then you can run the first rsync in advance and repeat it right before the move: the second time only the difference is transferred.
Step 5. The database on the new server and the first trap
One note on versions: in our test a dump from MariaDB 11.8 loaded into MariaDB 10.11 successfully, but it is safer to move to the same or a newer database version than the old server had.
On the new server we create an empty database and a user, then load the dump into it. We check that the posts are in place: the old site’s database has eight published rows (four posts, three pages and one internal WordPress entry), and there should be the same number here. The table prefix wp_ in the query is the default; yours may be different.

Note the last two lines: the site address is stored in the database itself (siteurl and home). While the domain stays the same, you do not need to change them, and this is one of the main ways to avoid breaking URLs. If you are moving to a different domain as well, that is a separate task with 301 redirects, and we do not cover it in this article.
Now one of the most common places where a move “breaks”: the settings file wp-config.php is still configured for the old server, not the new one. We deliberately checked what a visitor sees while it holds the old data:

Code 500 and “Database Error”: the site could not connect to the database. If the domain were already pointing at the new server at this moment, crawlers would get a server error on every page. That is why the order is “check first, DNS after”. In wp-config.php we fix the database name, user, password (DB_PASSWORD) and the database server address (on the same server as the site this is localhost):

In our test the old site ran in a container and took its settings from environment variables, while on the new server these variables are not set, so we had to replace them with plain values. In your case the values are most likely already written as text: just replace them with the new ones.
Step 6. The web server and the second trap: pretty URLs
The nginx configuration file for the site is small. The key line is try_files. It says: “if there is no such file or folder, pass the request to the site’s engine”. This is how WordPress serves addresses like /about/, which have no real file.
server {
listen 80;
server_name shop.lab.test;
root /var/www/shop.lab.test;
index index.php;
location / { try_files $uri $uri/ /index.php?$args; }
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
location ~ /\.ht { deny all; }
}The other lines: listen and server_name set the port and the site name, root is the folder with the files, index is the main file, the ~ \.php$ block passes PHP files to PHP-FPM for processing, and deny all blocks access to the service files .htaccess. The file goes in /etc/nginx/sites-available/, is enabled with a link in /etc/nginx/sites-enabled/, then checked with nginx -t and reloaded with systemctl reload nginx.
We tested what happens if the try_files line is “simplified” or forgotten: we replaced it with =404 and requested the URLs.

The home page opens, but the inner pages (we checked two) return 404. This is what a “lost site” looks like after a move: the home page is fine while the inner pages are unavailable. After the line was put back, the pages returned 200 again.
If the ufw firewall is enabled on the server, open ports 80 and 443 for the site (on our test server it was enabled and had no rules for 80 and 443, so we added them; without them the site will not open from outside):

Step 7. Check before switching DNS
The main step. The domain still points at the old server, visitors notice nothing, and we test the new one. The --resolve option overrides DNS for a single request: “for this name and port, use this IP address”, which is exactly what DNS will do after the switch. First a short check of four URLs, including a nonexistent one:

Now the full comparison of the twelve URLs: the snapshot of the new server against the snapshot of the old one. The diff command prints only the differences; empty output means “identical”.

On the new server, all twelve URLs gave the same response codes, the same titles, the same canonical URLs, the same redirects and the same page size to the byte. The check ran over http://: check HTTPS and the redirect from http:// to https:// separately, after the certificate is issued. Only when the snapshots match does it make sense to change DNS. If diff found differences, deal with those, not with DNS.
Step 8. Switch the domain and the certificate
In the DNS settings, replace the IP address in the A records (and AAAA, if present) with the address of the new server. Thanks to the TTL lowered in advance, visitors and crawlers will move to the new server faster, but not instantly, so do not turn the old server off until the old TTL expires, and leave some margin: those who have not refreshed their cache yet will see the old but working version.
The HTTPS certificate (the padlock in the address bar) for a site on nginx is usually issued with certbot after the domain already points at the new server: it needs to confirm that the name belongs to you. We did not do this part in the test because our test name has no real DNS. To avoid a window without HTTPS, you can issue the certificate before the switch using DNS validation, but we did not test this option. Do not leave the site without HTTPS if it had it, and do not forget to keep the redirect from http:// to https://.
What to check after the move
- Open the home page and several inner pages from an ordinary computer and from a phone.
- Run your snapshot again, now against the real domain: it should match the baseline.
- Make sure that
robots.txtdoes not close the site, and that in the WordPress settings (Settings → Reading) the “Discourage search engines from indexing this site” checkbox is not ticked. It often stays on after test copies. - Look at the Google Search Console and Yandex Webmaster reports: a rise in server errors or unavailable pages in the first days is a sign that something did not match.
- Watch for new posts and orders that may have appeared on the old server after the database dump: they will have to be moved again (we did not test this). It is better to schedule the move for a quiet time and briefly pause writes to the site.
FAQ
Will rankings definitely not drop?
It cannot be guaranteed: many factors affect them, and a move is one of them. But if the URLs, response codes, titles and canonical links stayed the same, and the site did not return errors during the switch, you have removed the typical causes of a drop.
Does the site need downtime during the move?
Not necessarily. While the domain points at the old server, it works as before, and you set up and test the new one in parallel. Downtime is needed only at the moment the data changes: if the site is updated often, it is better to freeze writes for a few minutes and repeat the database dump.
What if the domain changes too?
That is no longer a simple move: you need to set up permanent redirects (301) from the old URLs to the new ones and tell search engines about it. We did not test this scenario here.
Can I test the new server without changing DNS?
Yes, that is what the --resolve option of curl is for. To check in a browser, you can temporarily add the new server’s address and the site name to the hosts file on your computer and remove the entry after the check.
Key points
- Rankings can drop because of 404 and 500 errors on the new server, blocked indexing, disappearing HTTPS and changed URLs.
- Before the move, take a baseline: the response code, title, canonical URL and redirects of every important page.
- Move the database and the files together; with the same domain, do not change the site address in the database.
- Two traps from our test: in
wp-config.phpthe database connection settings from the old server were left (500 on all pages), and nginx had notry_files(404 on inner pages). - Check the new server with
curl --resolveanddiffbefore changing DNS. Keep the old server as a fallback until the old TTL expires.
Not checked here: certificate issuance, moving to a different domain, re-syncing data that changed, non-WordPress sites and databases of many gigabytes, DNS setup at a specific registrar. To secure a fresh server after the move, read “Securing a fresh VPS: the first 10 minutes”, and for backups before any move, “How to back up your VPS yourself: the full walkthrough”.
Read next
Deploy a server in 1 minute
Choose a location and a plan in the client area. The server starts automatically after payment.


