Migrating WordPress to AMPPS: Step-by-Step Tutorial
This tutorial walks you through migrating a live WordPress site to a local AMPPS environment for development, testing, or backup. Steps assume a basic familiarity with WordPress admin, file systems, and AMPPS (Apache, MySQL, PHP, Perl, Softaculous).
Prerequisites
- AMPPS installed on your computer and running Apache & MySQL.
- Local AMPPS root folder path (commonly: Windows: C:\Program Files\Ampps\www or macOS: /Applications/Ampps/www).
- Access to your live site’s WordPress admin and hosting control panel (cPanel, Plesk) or FTP/SFTP.
- phpMyAdmin access on both live host and local AMPPS (AMPPS includes phpMyAdmin).
Step 1 — Export your live WordPress database
- Log in to your hosting control panel and open phpMyAdmin (or use SSH with mysqldump).
- Select your WordPress database.
- Click Export → Quick → SQL → Go. Save the .sql file to your computer.
Alternative (if using WordPress admin):
- Use a migration plugin (e.g., Duplicator, All-in-One WP Migration) to export database and files together.
Step 2 — Download WordPress files
- Connect to your live site via FTP/SFTP or use the hosting file manager.
- Download the entire WordPress directory (usually public_html or www) — all files and folders including wp-content, wp-config.php, and .htaccess.
- Save the downloaded site folder to an easy-to-find location.
Step 3 — Create a local site folder in AMPPS
- Open the AMPPS www directory.
- Create a new folder for your site (e.g., mysite.local).
- Copy the downloaded WordPress files into this folder.
Step 4 — Create a local MySQL database
- Start AMPPS and open phpMyAdmin (http://localhost/phpmyadmin).
- Click Databases → Enter a name (e.g., mysite_db) → Create.
- Note the database name, and create (or note) a MySQL user and password. AMPPS default MySQL user is usually root with no password; but you can create a new user for clarity.
Step 5 — Import the database into AMPPS
- In local phpMyAdmin, select the new database.
- Click Import → Choose File → select the exported .sql file → Go.
- Wait for import success. If errors occur, try increasing upload/timeout limits in AMPPS’ php.ini or export using compressed SQL.
Step 6 — Update wp-config.php
- Open the wp-config.php file in your local site folder.
- Update DB_NAME, DB_USER, DB_PASSWORD, DBHOST to match your local database and credentials. Example:
Code
define(‘DB_NAME’, ‘mysite_db’); define(‘DB_USER’, ‘root’); define(‘DB_PASSWORD’, “); define(‘DB_HOST’, ‘localhost’);
- Save the file.
Step 7 — Update site URLs in the database
WordPress stores the site URL in the database; update these to match your local URL.
Option A — via phpMyAdmin:
- In phpMyAdmin, open the wp_options table (prefix may vary).
- Edit the values for option_name: siteurl and home to your local address, e.g., http://localhost/mysite.local or http://mysite.local (if you set up a hosts entry).
Option B — run SQL queries (phpMyAdmin → SQL):
Code
UPDATE wp_options SET option_value = ‘http://localhost/mysite’ WHERE option_name = ‘siteurl’; UPDATE wp_options SET option_value = ‘http://localhost/mysite’ WHERE optionname = ‘home’;
Option C — use WP-CLI or a search-and-replace tool/plugin for serialized data (recommended for complex sites):
- Use a PHP serialized-safe tool (e.g., interconnect/it Search Replace DB) or WP-CLI:
Code
wp search-replace ‘https://www.example.com’ ‘http://localhost/mysite’ –skip-columns=guid
Step 8 — Fix file permissions and .htaccess
- Ensure wp-content uploads folder and others are writable by your local web server.
- If permalinks break, go to WordPress admin → Settings → Permalinks and re-save to regenerate .htaccess.
- If .htaccess was not copied, create one with WordPress rewrite rules.
Step 9 — (Optional) Configure a local hostname
For a cleaner URL:
- Edit your OS hosts file to add:
Code
127.0.0.1mysite.local
- In AMPPS, add a new Virtual Host pointing to your site folder and hostname.
- Restart Apache and visit http://mysite.local.
Step 10 — Test the site locally
- Log in to WP admin (http://localhost/mysite/wp-admin).
- Check pages, posts, media, plugins, and themes.
- If images are broken, confirm uploads path and run a search-replace on URLs to update media links.
Troubleshooting tips
- Blank pages or errors: enable WP_DEBUG in wp-config.php to see errors.
- Database import errors: increase max_upload_size and max_execution_time in php.ini, or import via command line.
- Serialized data corruption: always use a serialized-aware search-replace tool when changing URLs.
- Plugin or PHP version issues: ensure AMPPS PHP version matches your live server’s PHP version.
Final notes
After finishing, you have a fully functional local copy of your WordPress site in AMPPS for development and testing. Keep sensitive production config (API keys, payment credentials) removed or replaced when working locally.
Leave a Reply