Duplicating a website can be useful for various reasons, such as creating a backup, setting up a staging environment for testing, or reusing an existing design for a new project. With OzSpeed’s hPanel, you can easily duplicate your website without needing extensive technical knowledge. Here’s a step-by-step guide to help you duplicate your website safely and efficiently.
Step 1: Backup Your Website #
Before duplicating your website, create a complete backup to ensure that you can restore your site if something goes wrong during the process.
How to Create a Backup: #
- Log in to your hPanel Dashboard at ozspeed.com.au.
- Go to Files > Backups.
- Click “Create New Backup” and wait for the process to complete.
- Download the backup file for safekeeping.
Tip: #
- Store a copy of the backup file on your local computer or cloud storage for extra protection.
Step 2: Set Up a New Hosting Account #
You need a separate hosting account or subdomain where you can duplicate the website.
How to Set Up a New Hosting Account: #
- Go to Hosting > Add New Website in hPanel.
- Choose a new domain or create a subdomain (e.g., staging.yourdomain.com).
- Click “Set Up Hosting” and follow the prompts to complete the setup.
Tip: #
- Use a subdomain if you’re creating a staging environment or testing changes before deploying them to the live site.
Step 3: Export Your Website Files #
You need to export your website files and database to duplicate the site.
How to Export Files: #
- Go to Files > File Manager in hPanel.
- Select the public_html folder and click “Download” to save the entire folder as a ZIP file.
How to Export the Database: #
- Go to Databases > phpMyAdmin in hPanel.
- Select your website’s database and click “Export”.
- Choose Quick Export and click “Go” to download the SQL file.
Tip: #
- Use the Download All Files option if you want to include additional folders outside of public_html.
Step 4: Upload the Website Files to the New Hosting Account #
After exporting the files, upload them to the new hosting account.
How to Upload Files: #
- Go to Files > File Manager in hPanel for the new hosting account.
- Open the public_html folder.
- Click “Upload” and select the ZIP file you downloaded earlier.
- Extract the ZIP file once the upload is complete.
Tip: #
- Ensure that all files are in the correct directory (e.g., public_html) to avoid broken links.
Step 5: Import the Database #
You also need to import the database for the duplicated website to function correctly.
How to Import the Database: #
- Go to Databases > phpMyAdmin for the new hosting account.
- Click “Import” and select the SQL file you exported earlier.
- Click “Go” to complete the import.
Tip: #
- If the database size is large, use the BigDump tool for a faster import process.
Step 6: Update the Configuration File #
You need to update the database credentials in the website’s configuration file to match the new hosting account.
How to Update wp-config.php
(for WordPress): #
- Go to Files > File Manager.
- Open the wp-config.php file in the editor.
- Update the following details:phpCopy code
define('DB_NAME', 'new_database_name'); define('DB_USER', 'new_database_user'); define('DB_PASSWORD', 'new_database_password'); define('DB_HOST', 'localhost');
- Click Save to apply the changes.
Tip: #
- If you’re not using WordPress, update the configuration file for your specific CMS (e.g.,
config.php
for Joomla).
Step 7: Update URLs in the Database #
If you’re duplicating the website to a new domain or subdomain, you need to update the URLs in the database.
How to Update URLs: #
- Go to phpMyAdmin and select the new database.
- Click on the SQL tab and run the following query:sqlCopy code
UPDATE wp_options SET option_value = REPLACE(option_value, 'old-domain.com', 'new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_posts SET guid = REPLACE(guid, 'old-domain.com', 'new-domain.com'); UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'old-domain.com', 'new-domain.com'); UPDATE wp_links SET link_url = REPLACE(link_url, 'old-domain.com', 'new-domain.com'); UPDATE wp_comments SET comment_content = REPLACE(comment_content, 'old-domain.com', 'new-domain.com');
- Click Go to execute the changes.
Tip: #
- Use a plugin like Better Search Replace in WordPress to simplify this process.
Step 8: Test the Duplicated Website #
Before making the duplicated website live, thoroughly test it to ensure everything is working correctly.
Testing Checklist: #
- Check All Pages: Ensure that all pages load correctly without errors.
- Test Forms: Submit a test message through any contact forms to verify they work.
- Verify Links: Click on all links to ensure they point to the correct domain or subdomain.
- Check Mobile Compatibility: Use the responsive design mode in your browser to test how the site looks on mobile devices.
Tip: #
- Use an incognito window or clear your browser cache to avoid seeing cached versions of the old site.
Step 9: Update SEO and Analytics Settings #
If you’re duplicating the website to a new domain, update your SEO settings and analytics tracking codes.
How to Update SEO Settings: #
- Go to Marketing > SEO Tools in hPanel.
- Update the Meta Title, Meta Description, and Keywords for the new domain.
Update Analytics: #
- Go to Settings > Tracking Codes.
- Replace the old Google Analytics tracking code with the new one.
Tip: #
- Use Google Search Console to submit a new sitemap for the duplicated site.
Step 10: Go Live with the Duplicated Website #
Once you’ve tested the duplicated site and made all necessary updates, it’s ready to go live.
How to Publish: #
- Click Publish in hPanel for the new hosting account.
- Confirm the domain settings and click “Go Live”.
Tip: #
- Inform your clients or team members about the new duplicated site, especially if it’s being used for testing or staging.
Troubleshooting Tips #
- Database Connection Error:
- Double-check the database credentials in the configuration file (
wp-config.php
orconfig.php
). - Ensure the database user has the correct permissions.
- Double-check the database credentials in the configuration file (
- Broken Links or Images:
- Use a link checker tool to find broken links.
- Update the URLs in the database or use a plugin like Better Search Replace.
- Website Not Loading Properly:
- Clear the website cache in hPanel and your browser cache.
- Verify that all files are in the correct directory (e.g., public_html).
Additional Tips: #
- Keep the Original Site Active: Maintain the original site until you’ve fully tested the duplicated version.
- Use Staging for Testing: Create a staging environment for testing major changes before deploying them to the live site.
- Regular Backups: Schedule regular backups in hPanel to protect your data.