Skip to content
Back to blog

Magichosting

Moving WordPress to a new host: step-by-step guide without downtime (web hosting or VPS)

E
Elias Bieber
Estimated reading time: 7 min

Move WordPress to a new host: with a plugin, manually via FTP or over SSH to a VPS – including testing via the hosts file, the DNS switch, SSL and a checklist, without taking your site offline.

WordPressMigrationWeb hostingVPSDNS

The short answer

A WordPress migration has four parts: the files (above all wp-content with themes, plugins and uploads), the database, the domain and its DNS records and the SSL certificate. You avoid downtime if the old site keeps running until you have tested the new one – and only then switch the DNS records.

At MagicHosting you move to web hosting – PHP, unlimited MySQL databases, FTP accounts and free SSL are included in every plan, from €1.98 per month – or to a VPS with root access for large sites and WooCommerce. Billing is prepaid with no minimum term, and a data processing agreement (DPA) is available for all products.

Which route fits your site?

RouteFor whomWhat you need
Migration pluginTypical websites and blogsA plugin such as Duplicator or All-in-One WP Migration and an FTP account
Manual (FTP + database export)Full control, very large media librariesAn FTP client, a database export from the old host, credentials for the new database
VPS with SSHLarge sites, WooCommerce, several installationsRoot access, rsync, mysqldump and WP-CLI
Magic TransitServer-to-server move to a MagicHosting VPSFree migration of files and databases – how it works

Preparation: 6 points before you move

  1. Update WordPress, the theme and all plugins at the old host – so you don't move old baggage along.
  2. Note the PHP version and any warnings under Tools › Site Health.
  3. Download a complete backup (files and database) and keep it locally.
  4. Lower the TTL of your DNS records 24 hours in advance (for example to 300 seconds) – the switch will then take effect faster.
  5. Check where your e-mail lives: if the MX record points to the old host, leave it for now. Only change it once the mailboxes move as well.
  6. Pick a quiet time window and – for shops or forums – don't accept orders or posts during the move (maintenance mode).

Step by step: moving to web hosting with a plugin

This route works for most websites and doesn't need any database tools. We show it with Duplicator; other migration plugins work in a similar way.

  1. Order web hosting: Dashboard › Products › Web & SSL › Web hosting. The plan is set up immediately.
  2. Open the panel from the web hosting management (sign-in with one click, no password), add your domain and create a new database with its own user.
  3. Under “Access” you'll find the user, password and host for FTP; under “Overview” the IPv4 and IPv6 address of the web hosting.
  4. On the old site, create a package with Duplicator and download both files: the archive and installer.php.
  5. Upload both files via FTP into your domain's directory on the web hosting.
  6. Test before switching DNS: add the web hosting's IPv4 for your domain to the hosts file on your PC. Only your computer will then load the domain from the new server.
  7. Open installer.php in the browser, enter the new database credentials and run the installation. Let it delete the installer files afterwards.
  8. Check everything: sign-in, pages, images, forms, permalinks and – for shops – a test purchase.
  9. Switch DNS: point the A record to the IPv4 and the AAAA record to the IPv6 of the web hosting. Only change the MX record if your e-mail moves too.
  10. As soon as the domain points to the web hosting, enable the free SSL certificate in the panel. Then remove the hosts entry on your PC again.
  11. Keep the old site running for a few more days until the DNS change has propagated everywhere – only then cancel at the old host.
# hosts file: Windows C:\Windows\System32\drivers\etc\hosts · macOS/Linux /etc/hosts
203.0.113.10   your-domain.com www.your-domain.com

Manual migration without a plugin

  1. At the old host, download all WordPress files via FTP/SFTP and export the database as an .sql file (for example with phpMyAdmin).
  2. Create a new database with a user in the web hosting panel.
  3. Upload the files via FTP into your domain's directory.
  4. Enter the new database credentials in wp-config.php (see below).
  5. Import the .sql file into the new database. If the panel has no import tool, temporarily upload a database tool such as Adminer (a single PHP file) – and delete it again right after the import.
  6. If the domain changes, replace the addresses in the database with a plugin such as Better Search Replace – never with a plain SQL query, or serialized data will break.
php
// wp-config.php – values from the web hosting panel
define( 'DB_NAME', 'database_name' );
define( 'DB_USER', 'database_user' );
define( 'DB_PASSWORD', 'strong-password' );
define( 'DB_HOST', 'host-from-the-panel' );

Moving to a VPS (large sites and WooCommerce)

On a VPS you get guaranteed resources and full control over the web server, PHP and the database. First set up nginx or Apache, PHP and MariaDB (guide: nginx with Let's Encrypt). The actual move:

bash
# Old server: back up the database consistently
mysqldump --single-transaction --quick -u DBUSER -p DBNAME > wordpress.sql

# New server: fetch files and dump from the old server
rsync -avz --progress old-server:/var/www/wordpress/ /var/www/wordpress/
scp old-server:~/wordpress.sql /root/

# Create database and user, import the dump
mysql -u root -p -e "CREATE DATABASE wordpress CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
mysql -u root -p -e "CREATE USER 'wp'@'localhost' IDENTIFIED BY 'strong-password'; GRANT ALL ON wordpress.* TO 'wp'@'localhost';"
mysql -u root -p wordpress < /root/wordpress.sql

# Only for a new domain: replace addresses safely (including serialized data)
wp search-replace 'https://old.example' 'https://new.example' --all-tables --path=/var/www/wordpress --allow-root

After the move

  • Permalinks: save once under Settings › Permalinks – this rewrites the redirect rules.
  • Caches: clear the caches of cache plugins and – if you use one – the CDN.
  • HTTPS: check that the WordPress Address and Site Address start with https://.
  • Backups: set them up yourself, for example with a plugin and an external storage target. On web hosting you back up yourself; VPS are additionally backed up daily to a second data centre. More: Backups with the 3-2-1 rule.
  • Search engines: if the domain stays the same, nothing else is needed. For a new domain, set up 301 redirects and report the change of address in Google Search Console.

Frequently asked questions

Will my website be offline during the move?

No, if you follow the order described: the old site keeps running until the new one is tested and the DNS records are switched. Just keep an eye on changes made on the old site in the meantime – that's why shops and forums should briefly use maintenance mode.

How long does the DNS switch take?

With a TTL lowered in advance, usually minutes to a few hours. Depending on the resolver it can occasionally take up to 24–48 hours – that's why the old site keeps running in parallel. Basics: DNS records explained.

Will my e-mail keep working?

Yes, as long as you don't change the MX record – the mailboxes then stay with the old provider. Web hosting includes unlimited e-mail addresses; if you use them, the MX record has to point to the web hosting.

Do I need SSH for the move?

No. With a migration plugin or manually via FTP you can do without SSH. SSH and WP-CLI are available on a VPS.

Web hosting or VPS – which is better for WordPress?

For company websites, blogs and small shops, web hosting is enough. For large WooCommerce shops, lots of simultaneous traffic or your own server software, a VPS with guaranteed resources is the better choice.

Can I move in a GDPR-compliant way?

Yes. The servers are located in the EU (Eygelshoven, Netherlands), and a data processing agreement under Art. 28 GDPR is available for all products – details on the DPA page.

Was this post helpful?

MagicHosting – Hosting with real value

Hosting pays off with MagicHosting: fair pricing, current deals and operation in SkyLink RZ. Servers, domains and personal support – no hidden costs.

  • Current limited offers from our server exchange
  • Affordable domains with transparent pricing and great offers
  • Powerful DDoS protection for maximum availability
  • Personal support when you have questions or issues