How to Migrate WordPress to A2 Hosting
In this article
Migrating a WordPress site to A2 Hosting means moving your website’s files, database, and settings from your current host to A2’s servers. This guide walks you through the entire process—from backing up your old site to updating your domain’s DNS—so you can switch hosts with minimal downtime. Before you start, you’ll need your current hosting account login, your A2 Hosting account credentials, and access to your domain registrar (where you bought your domain name).
What You'll Need
- Access to your current hosting control panel (cPanel, Plesk, or custom)
- Your A2 Hosting account login and cPanel credentials
- Your domain registrar login (e.g., GoDaddy, Namecheap, or your previous host)
- An FTP client (like FileZilla) or file manager in your hosting panel
- A text editor (like Notepad++) for editing the wp-config.php file
- A backup of your WordPress site (files and database) – you can create this during the steps
Step-by-Step
- Create a full backup of your current WordPress site. In your old hosting cPanel, open the “Backup” or “Backup Wizard” tool. Download a full backup of your home directory (which includes wp-admin, wp-content, etc.) and also export your database via phpMyAdmin (select your WordPress database, then “Export” – choose “Quick” and “SQL” format). Save both files to your computer.
- Set up your A2 Hosting account and get your new cPanel credentials. Log in to your A2 Hosting client area, then access cPanel. Note your new server’s IP address (you can find it in the “Welcome” email or under “Account Information”).
- Create a database on A2 Hosting. In A2 cPanel, go to “MySQL Databases.” Create a new database, then create a new MySQL user with a strong password. Add the user to the database and grant “ALL PRIVILEGES.” Write down the database name, username, and password.
- Upload your WordPress files to A2 Hosting. Use an FTP client (like FileZilla) to connect to your A2 account. Upload all files from your old site’s root directory (usually public_html) to the same directory on A2. If you’re moving to a subdomain or subfolder, adjust the target path accordingly.
- Import your database into A2. In A2 cPanel, open phpMyAdmin. Select your new database (the one you created), then click “Import.” Choose the .sql file you exported earlier and click “Go.” Wait for the import to complete.
- Edit wp-config.php to match your new database settings. In the wp-config.php file (in your WordPress root folder), update the DB_NAME, DB_USER, and DB_PASSWORD constants to the database name, user, and password you created on A2. Also, change the DB_HOST if A2 uses a different host (usually “localhost” is fine, but check your A2 welcome email or support docs).
- Update your site URLs (if needed). If your domain will stay the same, you can skip this step. But if you’re moving to a temporary URL or a different domain, you need to update the site URL and home URL in the database. In phpMyAdmin, browse to the wp_options table, find “siteurl” and “home,” and change their values to the new URL.
- Test the site on A2 before switching DNS. To preview your site on A2 without changing DNS, you can edit your local hosts file (on your computer) to point your domain to A2’s IP address. Or, if you have a temporary URL from A2, visit that URL. Check that the site loads, and that links and images work.
- Update your domain’s DNS nameservers. Log in to your domain registrar and change the nameservers to the ones A2 provided (usually ns1.a2hosting.com and ns2.a2hosting.com). If you’re only changing A records, update the “@” record to A2’s IP address.
- Wait for DNS propagation. DNS changes can take from a few hours up to 48 hours. During this time, some visitors may still see your old site. Once propagation is complete, your site will load from A2.
- Re-test your site on A2 after DNS update. Clear your browser cache and visit your domain. Ensure everything works: pages, images, plugins, and admin login.
- Cancel your old hosting (after a few days). Once you’re confident the site is stable on A2, cancel your old hosting plan to avoid extra charges.
Common Mistakes
- Forgetting to export/import the database correctly. Make sure you export the database as SQL, not as a zip or other format, and that the import completes without errors.
- Uploading files to the wrong directory. Double-check that you’re uploading to public_html on A2, not to a subdirectory like public_html/wordpress unless that’s your intention.
- Not updating wp-config.php. If you forget to change the database credentials, WordPress will display a “Error establishing a database connection” message.
- Changing DNS too early or too late. If you change DNS before the site is fully set up, visitors may see errors. If you wait too long, you may be paying for two hosts.
- Skipping the test step. If you don’t test before switching DNS, you might discover issues only after your site is live on A2, causing downtime.
Tips
- Use a migration plugin. A2 Hosting offers a free migration service (for most plans) – you can ask their support to migrate the site for you. Alternatively, plugins like Duplicator or All-in-One WP Migration can automate the process.
- Keep your old host active until DNS propagates. This reduces downtime – visitors will still see the old site until the new one is fully ready.
- Update your WordPress permalinks after migration. Go to Settings > Permalinks and click “Save Changes” to flush the rewrite rules, which can fix 404 errors.
- Check for hard-coded URLs. If any plugin or theme has hard-coded URLs (e.g., in custom code), they may break. Use a search-replace plugin to update URLs in the database.
- Enable SSL on A2. After migration, install an SSL certificate (free via Let’s Encrypt in cPanel) and force HTTPS to keep your site secure.
Troubleshooting
- Site shows “Error establishing a database connection.” Check your wp-config.php database credentials. Ensure the database name, user, and password are exactly as created. Also verify that the database host is correct (usually “localhost”).
- 404 errors on pages after migration. Go to Settings > Permalinks and click “Save Changes” to reset rewrite rules. If that doesn’t work, check your .htaccess file – it should contain WordPress rewrite rules. If missing, regenerate it by saving permalinks again.
- Images or files missing. Verify that all files were uploaded to the correct directory. Check file permissions – folders should be 755 and files 644. If you used FTP, ensure you uploaded in binary mode for images.
- Admin login not working. Clear your browser cache and cookies. If you changed the site URL, you may need to update the wp_options table again. Alternatively, use phpMyAdmin to reset your password via the wp_users table.
- Site is slow after migration. Clear WordPress caches (if you use a caching plugin). Also, check that your A2 hosting plan is sufficient for your traffic. You may need to enable caching or a CDN.
- Email not working. If your email is hosted with your old host, you’ll need to set up email accounts on A2 and migrate emails, or update your MX records to point to your email provider.
Frequently Asked Questions
Can A2 Hosting migrate my site for me?
Yes, A2 Hosting offers free migration for most new accounts. You can submit a migration request through your client area, and their team will move your site for you. This is often the easiest option if you’re not comfortable doing it yourself.
How long does the migration take?
If you do it yourself, it can take 1-2 hours, depending on your site size and your familiarity with the process. A2’s free migration typically takes 24-48 hours, but they’ll notify you when it’s done.
Will my site have downtime during migration?
If you follow the steps correctly (especially testing before changing DNS), downtime can be minimal – just the time it takes for DNS to propagate, which is usually under an hour but can take up to 48 hours. To avoid downtime, keep your old host active until the new site is fully live.
Do I need to change my domain nameservers?
Yes, unless you’re using a temporary URL or subdomain. To point your domain to A2, you must update the nameservers at your registrar to the ones A2 provides. This is a standard step in any hosting migration.
What if my site uses a custom theme or plugins?
They will migrate along with your files and database. However, some plugins may require re-activation or re-configuration after migration. Check your plugin settings and update any hard-coded URLs if necessary.
Can I migrate from a non-cPanel host?
Yes, the process is similar – you just need to access your files via FTP and export your database via phpMyAdmin or a similar tool. If your old host uses a different control panel, the steps are the same in principle.