A WordPress move consists of files, database and domain. Copy wp-content and the database to the new hosting, adjust wp-config.php, replace the old address in the database, test the site via the hosts file and only then switch DNS. This keeps the site reachable during the entire move.
Preparation
- Complete backup of the old site: files and database export.
- Check the PHP version on the new hosting, at least the same as before.
- Lower the domain's DNS TTL to 300 seconds, at least one day before.
- Deactivate cache plugins, they store the old address.
Step 1: transfer files
The decisive part is the wp-content folder with themes, plugins and uploads. Download WordPress itself fresh on the new hosting, which saves time and old leftovers. Large upload folders are best transferred via SFTP or, with your own server, with rsync directly from server to server.
Step 2: database and address
- Export the database, create an empty database on the new hosting and import the export.
- wp-config.php: enter the new database, user, password and host.
- If the domain stays the same, nothing else is needed. If it changes, replace the old address in the entire database with WP-CLI: wp search-replace old.de new.de. No simple search and replace, WordPress stores addresses in serialised fields.
Step 3: test before switching DNS
Enter the domain in your computer's hosts file with the new IP. Then only you see the new site under the real address, everyone else still the old one. Check the home page, subpages, images, forms, login and permalinks. Save the permalink settings once so that the .htaccess is generated.
Step 4: switch DNS
Set the A record to the new IP. With TTL 300 this takes effect within minutes. Keep the old site running for another one or two weeks so that visitors with old DNS caches can still be served. Remove the hosts entry at the end.
Web hosting for WordPress
Web space with selectable PHP version or your own server with Plesk. Domains, DNS and e-mail in the same customer area.