how to clone WordPress site manually

Cloning a WordPress site manually involves creating an exact replica of your website, including the database, files, themes, and plugins. This process is crucial for several reasons such as testing changes, moving to a new host, or creating development sites without affecting the live site.

Step 1: Preparing for cloning

Backup Original Site

Start by backing up the original WordPress site. Use an FTP client like FileZilla or an SSH terminal to access your website files directly on your web server. Navigate to the root directory of your WordPress site, usually named public_html or www. Here, select all files and folders and download them to your local computer.

Concurrently, export your WordPress database. Access your hosting control panel, find the phpMyAdmin tool, and select the database associated with your WordPress site. Once inside, click on the ‘Export’ tab. Choose the ‘Quick’ export method and the ‘SQL’ format, then press ‘Go’. This will download the database SQL file to your computer.

Step 2: Setting Up the Destination Site

Create a Database on New Host

Log in to the cPanel or equivalent on your new hosting account. Look for the MySQL Database Wizard and create a new database. Note down the database name, the username, and the password as you’ll need them later.

Modify the wp-config.php File

Extract the downloaded WordPress files on your local computer and locate the wp-config.php file. Open it with a text editor like Notepad++. Replace the database name, username, and password with the new ones you just created.

Step 3: Uploading WordPress Files

Using your FTP client, connect to the new hosting account and upload the WordPress files to the desired location (typically the public_html folder). Ensure the root directory is clear or align with your domain/subdomain configuration.

Step 4: Importing the Database

Return to phpMyAdmin in your new host’s control panel. Select the new database you created from the left-hand sidebar. Click on the ‘Import’ tab at the top. Click on ‘Choose File’ and select the SQL file you exported earlier. Press ‘Go’ at the bottom to import your WordPress database.

Step 5: Search and Replace URLs

Since your domain name might change with the migration, it’s vital to update all URLs in your database. Use the SQL command in phpMyAdmin:

UPDATE wp_options SET option_value = replace(option_value, 'oldurl', 'newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'oldurl','newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'oldurl', 'newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'oldurl','newurl');

Replace ‘oldurl’ with your original site URL and ‘newurl’ with your new site URL.

Step 6: Configure Permalinks

Log into your new WordPress site’s dashboard using the same admin credentials. Go to Settings > Permalinks, select your preferred permalink structure and save changes. This step ensures your site’s URL structure remains consistent with your SEO goals.

Step 7: Fix Serialised Data

Moving a WordPress site manually can sometimes mess up serialized data like widget settings, theme settings etc. To fix any issues with serialized data, use a serialization fixer tool such as Serialized Data Fixer. This tool can help adjust serialized string lengths automatically.

Step 8: Test the New Site

Extensively test the new site to ensure everything is working correctly—check for broken links, test out functionalities, review appearance settings, and confirm forms and other integrations work as expected.

Step 9: Update DNS Settings

If you are moving to a new domain or server, update your DNS settings to point to the new server’s IP address. DNS propagation can take up to 48 hours.

Step 10: Monitoring

After going live, monitor the site for any unexpected issues. Use tools like Google Analytics and Webmaster Tools to keep an eye on traffic and site health.

SEO Considerations

Ensure that all SEO aspects like meta tags, alt tags, and robots.txt files are correctly set up. Check Google’s Search Console for crawl errors and re-submit your sitemap.

This manual method of cloning gives you complete control over the migration process, valuable for advanced users seeking maximum customization. However, always ensure you have backup copies before proceeding, and if needed, consult with a web development professional.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *