English
Clone Website
Clone Website duplicates a website to another domain on the same server, or to another server in your FlashPanel account. Use it to:
- Create a staging or development environment from a live website.
- Move a website to a new server.
- Set up several identical websites on different domains.
Clone a website
- Open the site's Overview page.
- In the Utilities group, select Clone Website.
- Fill in the fields:
- Destination Server: the server that receives the copy. Defaults to the current server.
- Website domain: the domain of the copy, in the form
domain.com(nohttp://orhttps://). Press Tab, Enter or , to add several domains; each domain creates a separate copy. The domain must not match an existing website on the destination server. - Owner (optional): the Linux user that owns the copy. Pick one from the list or type a new name (the user is created if it does not exist;
rootis not allowed). Leave it empty to use the same user as the source website; when cloning to another server and the source uses the default user, the copy uses the destination server's default user. - Clone Database (only shown when the website has a database): also copy the database.
- Clone Deploy Script (only shown when the website has a deploy script, enabled by default): keep the deploy script on the copy.
- Click Clone Website.
Cloning runs in the background. Follow its progress and see any errors on the source website's Events page.
Cloning to another server
If the destination server has no web server, FlashPanel installs the same web server as the source server (plus the website's PHP version with Nginx or Apache). If the destination already has a web server, make sure it is the same type and has the PHP version the website needs (see PHP).
What gets cloned
- Source code: the whole website directory, including the
.gitdirectory and the.envfile (copied as is). - Web server configuration: the Nginx/OpenLiteSpeed/Apache configuration and custom configuration blocks, with the domain and paths changed for the copy.
- Website settings: PHP version and web directory.
- Database (when Clone Database is checked): a new database and database user (with a new password) are created on the destination server, then all data from the source website is imported.
- Deploy script (when Clone Deploy Script is checked).
For WordPress websites cloned with their database, FlashPanel updates wp-config.php for the new database and replaces the old domain with the new one in the database. For other applications, update the connection details yourself (for example in the .env file).
What does not get cloned
- SSL certificates.
- Auto deployment.
- Load balancing, WP Rocket and 8G Firewall (disabled on the copy).
- Alias domains.
- The server's cron jobs and background workers (queue workers).
After cloning
- Point the new domain's DNS record to the destination server's IP address.
- Install an SSL certificate for the new domain.
- Update the application's
.envor configuration file: domain, database details, and so on. You can open.envdirectly from the Utilities group on the Overview page. - If you use Git, check the deployment settings and re-enable auto deployment if needed.
- Recreate cron jobs and background workers if the application needs them.
- Open the website and check that it works.
When using this feature to move a website to a new server, you can keep the same domain (enter the same domain in Website domain), switch DNS to the new server once you have checked it, and only then delete the old website.
Troubleshooting
Cloning failed
- Open the event details to read the error message.
- Check the free disk space on the destination server.
The website does not work after cloning
- Check that the DNS record points to the right server.
- Read the Error Log in the new website's Nginx/Apache menu.
- Check the website's PHP version on the Settings page.
- For file permission errors, use Fix File Ownership in the Utilities group.
Cannot connect to the database
- Check that the database details in the application's configuration file (for example
.env) match the new database. The new database and user names are shown on the copy's Overview page; if you need the password, change that user's password on the destination server's Database page, then update the configuration file.
The cloned WordPress website redirects to the original domain
FlashPanel replaces the old domain with the new one in the database, but WordPress still redirects if wp-config.php hardcodes the address:
php
define('WP_HOME', 'https://old-domain.com');
define('WP_SITEURL', 'https://old-domain.com');- Open
wp-config.phpof the copy (the wp-config.php tile on the WordPress page, or the File Manager) and delete these two lines, or change them to the new domain. - If OPcache is enabled, reload PHP-FPM so the change takes effect (see Restart PHP-FPM).
- Clear any cache plugin or CDN cache, then open the new domain again.
Notes
- You can only clone to servers you are allowed to manage in your FlashPanel account.
- Alias domains cannot be cloned; clone the main website instead.
- Large websites take longer to clone.
- Take a recent backup before cloning a live website.