Safely Migrating Your WordPress Site from Staging to Live with Duplicator: A Step-by-Step Guide

Migrating a WordPress website can feel like a daunting task, especially when moving from a carefully constructed staging environment to a live, public-facing server. The good news is that with the right tools and a systematic approach, it can be a smooth and stress-free process. This tutorial will walk you through the entire process of…

Migrating a WordPress website can feel like a daunting task, especially when moving from a carefully constructed staging environment to a live, public-facing server. The good news is that with the right tools and a systematic approach, it can be a smooth and stress-free process. This tutorial will walk you through the entire process of moving your WordPress site from a staging environment to your live server using the popular Duplicator plugin.

A staging site is a private, duplicate version of your live website where you can test changes, update plugins, themes, or core WordPress files, and develop new features without affecting your live audience. Once you’re happy with the changes on staging, the next logical step is to deploy those changes to your live site. Duplicator simplifies this by creating a “package” of your entire WordPress site – including all files, themes, plugins, and the database – and then allowing you to “install” this package on a new server or overwrite an existing one.

By following this guide, you’ll learn how to safely and efficiently migrate your WordPress site, minimizing downtime and potential issues. Let’s get started!


Before You Begin: Essential Preparations

Before initiating any migration, it’s crucial to prepare your environment. Skipping these steps can lead to data loss or a broken website.

  1. Backup Your Current Live Site (CRITICAL!): If your live server currently hosts an active website, you must perform a full backup before proceeding. This includes all WordPress files and the database. Many hosting providers offer one-click backup solutions via cPanel or a custom control panel. You can also use a plugin like UpdraftPlus or manually back up via FTP and phpMyAdmin. This backup is your safety net in case anything goes wrong.
  2. Ensure Your Staging Site is Ready: Your staging site should be thoroughly tested and fully functional. All changes you wish to push live should be implemented and verified.
  3. Gather Login Credentials: You’ll need:
  • WordPress admin credentials for your staging site.
  • FTP/SFTP or cPanel access credentials for your live server.
  • (Optional, but recommended) Database credentials (username, password, database name, host) for creating a new database on your live server.
  1. Download the Duplicator Plugin: You’ll install this on your staging site first.

Phase 1: Preparing Your Staging Site for Migration

The first step is to create a “package” of your staging site using Duplicator. This package will contain all your WordPress files and a snapshot of your database.

Step 1: Install and Activate Duplicator on Your Staging Site

  1. Log in to your staging site’s WordPress admin dashboard.
  2. Navigate to Plugins > Add New.
  3. In the search bar, type “Duplicator”.
  4. Locate “Duplicator – WordPress Migration & Backup Plugin” by Snap Creek and click Install Now.
  5. Once installed, click Activate.
  • Tip: After activation, a new menu item called “Duplicator” will appear in your WordPress admin sidebar.

Step 2: Create a Duplicator Package

  1. From your staging site’s dashboard, go to Duplicator > Packages.
  2. Click the Create New button at the top right.
  3. Name the Package (Optional but Recommended): You can keep the default name or give it a descriptive name like “Staging to Live [Date]”.
  4. Configuration (Optional):
  • Storage: By default, Duplicator will store the package on your server. For most migrations, this is fine.
  • Archive: This section allows you to filter which files and folders are included in your package. For a full migration, you generally don’t need to change anything here. However, if your staging site has very large temporary files or specific development-only plugins you don’t want on live, you can exclude them here.
  • Database: Similar to archives, you can specify tables to exclude. Again, for a full migration, leave this untouched.
  • Tip: If your staging site is very large (many gigabytes), consider reviewing the “Archive” section to exclude unnecessary files like old backups, large log files, or caching plugin directories if you plan to reconfigure caching on the live site anyway.
  1. Click the Next button.
  2. Scan Your Staging Site: Duplicator will now scan your site for potential issues.
  • Warnings: It might show warnings like “Large Files” or “PHP Version”. Read these carefully. Often, they are informational and won’t stop the process. However, if you see critical errors, address them before proceeding.
  • Note: Pay attention to the “Total Size” of the package. Ensure your live server has enough disk space to accommodate it.
  1. Once the scan is complete and you’ve reviewed any warnings, check the box that says “Yes. Continue with the build process!”
  2. Click the Build button.
  3. Download Your Package: Duplicator will now create the package. This may take some time depending on your site’s size. Once complete, you will see two files available for download:
  • Installer: A ZEALTERCODE0 file.
  • Archive: A ZEALTERCODE0 file (e.g., ZEALTERCODE1).
  • Click the One-Click Download button to download both files simultaneously. Store them in a safe place on your computer.

Phase 2: Preparing Your Live Server

Now that you have your site’s package, it’s time to prepare your live server to receive it.

Step 3: Create a New Database for Your Live Site (If Replacing an Existing Site)

  • Important: If you are migrating your staging site to an entirely new domain or a sub-directory that does not yet have a WordPress installation, you must create a new database. If you are overwriting an existing live WordPress site, Duplicator can optionally use the existing database (and wipe it), but creating a new one is generally safer for a cleaner migration. We’ll proceed with creating a new database for maximum safety and clarity.
  • Access your hosting control panel (e.g., cPanel).
  • Look for MySQL® Databases or a similar database management tool.
  • Create a New Database:
  • Provide a name for your new database (e.g., ZEALTERCODE0).
  • Click Create Database.
  • Create a New Database User:
  • Provide a username (e.g., ZEALTERCODE0) and a strong password.
  • Click Create User.
  • Add the User to the Database:
  • Select the database you just created and the user you just created.
  • Click Add.
  • On the next screen, select ALL PRIVILEGES and click Make Changes.
  • Record these details: Database Name, Username, and Password. You’ll need them in Step 6.
  • Tip: Some hosts prepend your cPanel username to database names and usernames (e.g., ZEALTERCODE0). Make sure to use the full, exact name.

Step 4: Upload Duplicator Files to Your Live Server

  1. Connect to your live server using an FTP client (like FileZilla) or your hosting provider’s cPanel File Manager.
  2. Navigate to the root directory where your WordPress site will reside. This is typically ZEALTERCODE0, ZEALTERCODE1, or a specific subfolder if you’re installing WordPress there (e.g., ZEALTERCODE2).
  • Crucial Step: If there is an existing WordPress installation in this directory that you intend to replace with your staging site, DELETE ALL EXISTING FILES AND FOLDERS IN THIS DIRECTORY FIRST. Ensure you have backed up your live site as per the “Before You Begin” section before deleting anything!
  • If you’re deploying to a completely empty directory, simply navigate to it.
  1. Upload the ZEALTERCODE0 file and the Duplicator archive ZEALTERCODE1 file (e.g., ZEALTERCODE2) you downloaded in Step 2 into this empty directory.
  • Tip: Ensure both files are uploaded directly into the root of where your WordPress site should be, not inside a subfolder.

Phase 3: Running the Duplicator Installer on Your Live Site

With the package uploaded, you can now run the installer script to deploy your site.

Step 5: Access the Duplicator Installer in Your Browser

  1. Open your web browser and navigate to the ZEALTERCODE0 file on your live server.
  • If your domain is ZEALTERCODE0 and you uploaded the files to ZEALTERCODE1, the URL will be: ZEALTERCODE2
  • If you uploaded it to a subfolder like ZEALTERCODE0, the URL would be: ZEALTERCODE1
  1. You should see the Duplicator installer interface.
  2. Read the “Duplicator Terms & Notices” and check the box “I have read and accept all terms & notices.”
  3. Click the Next button.
  • Troubleshooting: If you see a blank page or an error, check:
  • If ZEALTERCODE0 was uploaded correctly.
  • File permissions (often 644 for files and 755 for folders).
  • Your server’s PHP version meets Duplicator’s requirements (usually PHP 7.4 or higher).
  • Your ZEALTERCODE0 file if it was corrupted during the deletion phase.

Step 6: Configure Database Settings

This is where you connect your new site to the database you created in Step 3.

  1. Under Setup > Install Type, select “Connect and Remove All Data”. This option is ideal for replacing an existing site or installing into a new, clean database.
  2. Database Host: This is usually ZEALTERCODE0. If your host specifies something different, use that.
  3. Database Name: Enter the full database name you created in Step 3.
  4. Database User: Enter the full database username you created in Step 3.
  5. Database Password: Enter the password for your database user.
  6. Click the Test Database button to ensure the connection works. If successful, you’ll see a “Success” message. If not, double-check your credentials and the database/user setup in your cPanel.
  7. Click the Next button.
  • Warning: Duplicator will now warn you that it will permanently remove all data from the selected database. Since we’re using a new, empty database (or confirmed a full backup), this is fine. Confirm by clicking “OK”.

Step 7: Update URL & Path Settings

Duplicator is smart and usually auto-detects the correct URL and path for your live site.

  1. New URL: Verify that this URL is your live domain (e.g., ZEALTERCODE0).
  2. New Path: Verify that this path is the absolute server path to your WordPress installation (e.g., ZEALTERCODE0).
  3. Validate: Click the “Validate” button next to the URL to ensure it resolves correctly.
  • Tip: If you’re moving from HTTP to HTTPS, ensure your “New URL” includes ZEALTERCODE0. You’ll still want to update internal links using a plugin like Better Search Replace after migration.
  1. Click the Next button.

Step 8: Final Review and Finish

  1. Duplicator will display a summary of the installation. Review everything carefully.
  2. Click the Admin Login button. This will take you to the WordPress admin login screen of your newly migrated live site.
  3. Log in using the WordPress admin credentials from your staging site. The user accounts, passwords, and content from your staging site have now been transferred to live.

Phase 4: Post-Migration Cleanup and Checks

You’ve successfully deployed your staging site to live! Now, it’s time for crucial final steps.

Step 9: Perform Post-Migration Cleanup

  1. After logging into your live site’s WordPress admin, Duplicator will often present a “Cleanup” screen or a notification.
  2. Navigate to Duplicator > Tools > Remove Data.
  3. Click the “Remove Installation Files” button. This deletes ZEALTERCODE0, the ZEALTERCODE1 archive, and other temporary Duplicator files from your server. This is crucial for security!
  4. Deactivate and Delete the Duplicator Plugin from your live site (Plugins > Installed Plugins). You only need it for migrations, not ongoing site operation.
  • Tip: If you skipped removing installation files and deleted the plugin, you’ll need to manually delete ZEALTERCODE0, ZEALTERCODE1, and the ZEALTERCODE2 folder from your server via FTP/File Manager.

Step 10: Thoroughly Test Your Live Site

This is perhaps the most important step. Don’t assume everything works perfectly.

  1. Clear Caches: If you use a caching plugin on your live site, clear its cache. Clear your browser’s cache as well.
  2. Check All Pages and Posts: Navigate through your site. Click on various pages, posts, and custom post types to ensure they load correctly.
  3. Verify Images and Media: Ensure all images, videos, and other media files are displaying properly.
  4. Test Forms: Submit all contact forms, newsletter sign-ups, and any other forms to ensure they are sending emails correctly.
  5. Check Links: Click internal and external links to verify they resolve to the correct destinations.
  6. Test E-commerce Functionality (if applicable): If your site is an online store, perform test purchases, check product pages, cart, checkout, and payment gateways.
  7. Review Settings:
  • Go to Settings > Permalinks and simply click “Save Changes” (even if you made no changes) to re-flush your permalink rules. This often fixes 404 errors on migrated sites.
  • Check Settings > General to confirm the WordPress Address (URL) and Site Address (URL) are correct for your live site (e.g., ZEALTERCODE0).
  • Review any third-party API keys or service integrations (e.g., Google Analytics, SEO tools, security plugins) that might need to be re-authenticated or updated for the live domain.
  1. Monitor Your Site: Keep an eye on your server logs and Google Search Console for any unexpected errors or issues in the days following the migration.

Conclusion

Congratulations! You’ve successfully migrated your WordPress site from staging to live using Duplicator. This powerful plugin streamlines what used to be a complex, manual process, making it accessible even for those without extensive technical expertise. By following these detailed steps, you’ve ensured a secure and effective transition for your website. Remember, always prioritize backups, and thoroughly test your site after any major changes or migrations to guarantee a seamless experience for your visitors.


Was this helpful?

Previous Article

How to Diagnose and Fix the "Error Establishing a Database Connection" in WordPress

Next Article

Mastering On-Page SEO: A Step-by-Step Guide to Optimizing Your WordPress Post with Yoast SEO

Write a Comment

Leave a Comment