With xCloud, you can easily clone a website from Git Repository with xCloud without any complexity at all. The migration process is exceptionally fast, ensuring a rapid transition without introducing any alterations to the code within your Git repository. With the below steps, you can easily migrate an existing WordPress from Git Repository. Letโs follow this guide to get started.
How To Migrate A Site From Git #
Migrating a website from a Git repository with xCloud involves several easy steps. The below guide can help you to understand how you can perform this migration. Follow the steps below to migrate a site from a Git Repository.ย
Step 1: Select Option To Clone A Website #
First, log into your xCloud account. From the dashboard, click on โ+New Siteโ button. Now, choose a server to add a site and click โNextโ. Go to โClone a Git Repositoryโ option.
Step 2: Select Destination Server #
From the โDestinationโ tab, select the destination server to migrate your site. You can keep the server that is already selected, or you can change it from the dropdown. Then, click on โNextโ.
Step 3: Set Up Domains #
From the โDomainsโ tab, you will get two options, either you can create your site in a staging domain and refine it until it is ready for launch, or, you can migrate into a new domain to get your site up and running in a new domain.
Migrate Into A New Domain
To create a site with your live domain, you need to select โMigrate into a New Domainโ option. Then you have to put โNew Site Titleโ and โDomain Nameโ.
Here, you need to enable HTTPS to make your website more secure. From the DNS Setup section, toggle on the โDo You Want To Enable HTTPS?โ option. After enabling it, you will get two options to select. Either choose to use a free SSL certificate issued & managed by xCloud, or, you can provide the certificate and manage it yourself. Select according to your choice.
Staging Environment
Instead of migrating into a new domain, you can select the โStaging Environmentโ option. xCloud offers a temporary staging domain to make your site live which helps promptly showcase your site’s progress and collect feedback from teammates or clients. Subsequently, you can integrate your custom domain to make the site accessible to your users or visitors. Now, click on โNextโ.
Note: For this documentation, we are going with the โStaging Environmentโ option.
Step 4: Settings To Manage Database #
In the โSettingsโ tab, you will see the โPHP Versionโ and โSite Usersโ. You can change these according to your choice. Also, you will see two caching options: โFull Page Cachingโ and โRedis Object Cachingโ. You can enable both of these options.
Now, it is time for database management. You will get two options. Either you can create a new database on the server, or, you can add your existing database that is hosted on another server.
Create Database In Server
If you select this option, you need to get a โDatabase Nameโ, โDatabase Usernameโ and โDatabase Passwordโ. You can keep these auto-generated credentials, or you can modify them according to your choice.
Add Your Existing Database
If you select this option, you need to put in a few information and credentials such as โDatabase Hostโ, โDatabase Portโ, โDatabase Userโ, โDatabase Nameโ, and โDatabase Passwordโ. Please make sure that the database connection configuration is correct.
After selecting any one option and providing all essential information and credentials, click on โNextโ.
Note: For this documentation, we are going with โCreate Database In Serverโ option.
Step 5: Insert Git Repository Credentials #
In the โGit Repoโ Tab, add your โGit Repositoryโ and โGit Branchโ. Also, toggle on โEnable push to deployโ option.
Once you enable the โPush To Deployโ, it will generate a โDeployment URLโ. โPush To Deployโ is a way to automatically deploy your site live once you push code to a Git repo. We need to insert this URL into GitHub. Letโs copy the โDeployment URLโ
Step 6: Add Deployment URL In Git Repository #
Now, go to your Git Repository. From the ‘Code‘ tab, go to the โSettingsโ tab and click on โWebhooksโ page from the โCode and automationโ section of the left navigation. Insert the Deployment URL into the โPayload URLโ field. Select the โApplication/jsonโ from the โContent typeโ dropdown.
Step 7: Add Public Key In Git Repository #
From the xCloud dashboard, copy the โPublic Keyโ to add it to your Git repository as a deploy key. Git migration uses the โPublic Keyโ for SSH authentication. This is necessary to enable xCloud to access your Git repository and clone it. It ensures secure and authorized access for the cloning process.
Now, again, go to your Git Repository. From the ‘Code‘ tab, go to the โSettingsโ tab and click on โDeploy Keysโ in the security section of the left navigation. Click on the โAdd Deploy Keyโ button and paste the key that you copied from xCloud.
After inserting the deploy key in GitHub, click on โNextโ on your xCloud settings of the โGit Repoโ tab.
Step 8: Confirm Migrating The Website #
Now, to start the migration process, click on the โStartโ button.
After clicking on the โStartโ button, the migration process will start. And, you will see the progress of migrating.
The Git Repository must contain a wp-config-sample.php. xCloud generates a wp-config.php file from wp-config-sample.php file with the database information.
Note: You can choose whether you want to import your old database or not. So, here is an optional step below. You need to follow this after the migration process is complete.
How To Import Your Database In SQL Format #
To import the database from your old site, you need to connect your Database client such as TablePlus. From your xCloud dashboard, take the โDatabase Connection URLโ from the SSH/sFTP page of your site.
Now, go to TablePlus dashboard. Click on the โ+โ icon, then click on โImport from URLโ. Paste the Connection URL and hit the โImport; button. Then click on โSaveโ.
Now you can delete the tables that were automatically generated by xCloud and import your desired database.
Setup The Site After Completing Git Migration #
When the migration process is complete, you can visit the site. You need to choose the language and provide necessary information such as โSite Titleโ, โUsernameโ, โEmailโ, etc. Now, you can access the site by logging in.
After Migration Deployment Settings #
After the migration process is complete, you can change the Git Branch, turn on or off the โPush To Deployโ feature, run Deploy Scripts by inserting the scripts, etc. Go to GitHub page from the site dashboard, update things you want to change, and hit the โSaveโ button.
Thatโs it! You have successfully cloned a website from the Git repository with xCloud.
Still stuck? Contact our dedicated support team for any of your queries.