Skip to content

Clone Website

The Clone Website feature allows you to duplicate an existing website to another server or to multiple domains on the same server. This is particularly useful when you need to:

  • Create staging or development environments
  • Migrate websites between servers
  • Set up multiple instances of the same website
  • Replicate website configurations quickly

How to Clone a Website

  1. Navigate to the website management dashboard
  2. In the Utilities section, select the Clone Website option
  3. Configure the clone settings

Clone Configuration Options

When cloning a website, you have the following options:

Destination Server

Select the server where you want to clone the website to. You can choose:

  • Same Server: Clone to the same server with a different domain name
  • Different Server: Clone to another server in your FlashPanel account

! Server Compatibility

The destination server must support the same web server type (Nginx, OpenLiteSpeed, or Apache2) as the source server. If the destination server doesn't have the required web server or PHP version installed, FlashPanel will automatically install them for you.

Website Domain(s)

Enter the domain name(s) for the cloned website. You can:

  • Enter a single domain name (e.g., clone.example.com)
  • Enter multiple domain names separated by commas, tabs, or pressing Enter
  • Each domain will create a separate website clone with the same configuration

Format: domain.com (without http:// or https://)

Clone Database

If your source website has a database, you can optionally clone it:

  • Enabled: The database will be cloned to the destination server with the same structure and data
  • Disabled: Only the website files and configuration will be cloned (database not included)

Database Cloning

When cloning the database, FlashPanel will:

  • Create a new database on the destination server
  • Copy all tables, data, and structure from the source database
  • Update the website configuration to use the new database credentials

What Gets Cloned

When you clone a website, the following items are copied:

Website Files

  • All files and directories in the website root directory
  • Public web directory structure
  • Application source code

Configuration

  • Nginx/OpenLiteSpeed/Apache2 configuration
  • PHP version settings
  • Web directory path
  • Site isolation settings (if applicable)

Database (Optional)

  • Database structure (tables, indexes, constraints)
  • All database data
  • Database user and permissions

SSL Certificate (Optional)

If the source website has an SSL certificate installed, it can be cloned separately using the Certificate Clone feature.

What Does NOT Get Cloned

The following items are not cloned:

  • Deployment scripts and hooks (configured in FlashPanel)
  • Environment variables
  • Cron jobs
  • Queue workers
  • Site aliases
  • Custom Nginx rules (you may need to reconfigure them)

Git Repository

The .git directory and all Git files are cloned along with your website files. However, you'll need to reconfigure the deployment settings in FlashPanel if you want to use the auto-deployment feature.

Automatic Installation

When cloning to a different server, FlashPanel will automatically:

  1. Install Web Server: If the destination server doesn't have the same web server (Nginx, OpenLiteSpeed, or Apache2) as the source, it will be installed automatically
  2. Install PHP Version: If the destination server doesn't have the required PHP version, it will be installed automatically
  3. Create System User: If using site isolation, the appropriate system user will be created

Clone Process

The cloning process is executed in the background as an event. You can monitor the progress:

  1. After clicking the Clone Website button, an event will be created
  2. Navigate to the Events page (in the server sidebar) to monitor the progress
  3. You'll receive a notification when the cloning is complete
  4. If any errors occur, they will be displayed in the event details

Post-Clone Steps

After the website has been cloned, you should:

  1. Update DNS Records: Point the new domain to the destination server's IP address
  2. Install SSL Certificate: Install an SSL certificate for the new domain if needed
  3. Configure Git Deployment (if needed): The .git directory is cloned, but you need to configure deployment settings in FlashPanel if you want to use auto-deployment features
  4. Update Environment Variables: Configure any environment-specific settings (e.g., .env file)
  5. Test the Website: Verify that the cloned website works correctly
  6. Configure Cron Jobs: Set up any scheduled tasks if needed
  7. Configure Queue Workers: Set up background job processing if needed

Common Use Cases

Creating a Staging Environment

Clone your production website to a staging domain:

  1. Select your production website
  2. Choose the same or different server
  3. Enter staging domain (e.g., staging.example.com)
  4. Enable database cloning to get a full copy of production data
  5. After cloning, update environment variables for staging configuration

Migrating Between Servers

Move a website from one server to another:

  1. Select the website you want to migrate
  2. Choose the destination server
  3. Use the same domain name
  4. Enable database cloning
  5. After cloning, update DNS to point to the new server
  6. Once verified, you can delete the old website

Creating Multiple Instances

Deploy the same application to multiple domains:

  1. Select the source website
  2. Choose the destination server
  3. Enter multiple domains separated by commas
  4. Decide whether to clone the database (or use a shared database)
  5. Configure each instance with its own environment variables

Troubleshooting

Clone Failed

If the clone operation fails:

  1. Check the event details for error messages
  2. Verify that you have sufficient disk space on the destination server
  3. Ensure the destination server has the required PHP extensions
  4. Check that the database name doesn't already exist on the destination server

Website Not Working After Clone

If the cloned website doesn't work:

  1. Verify DNS records are pointing to the correct server
  2. Check file permissions in the website directory
  3. Verify database credentials in the website configuration
  4. Review Nginx/OLS error logs for specific issues
  5. Ensure the PHP version matches your application requirements

Database Connection Issues

If the cloned website can't connect to the database:

  1. Verify the database was created successfully
  2. Check database credentials in your application's configuration file (e.g., .env)
  3. Ensure the database user has the correct permissions
  4. Verify the database service is running on the destination server

Limitations

  • You can only clone websites to servers within your FlashPanel account
  • The destination server must support the same web server type as the source
  • Large websites may take longer to clone
  • Website aliases cannot be cloned (they need to be recreated manually)

Best Practice

Before cloning a production website, ensure you have a recent backup. This allows you to restore quickly if any issues occur during the cloning process.