Deploying sites to a live server
After you finish the development of an Xperience website, you typically need to deploy the site to a remote hosting server (production environment).
You can use the following process for the initial deployment:
Transfer your web project files from your local environment to the hosting server. You need to deploy both your live site (MVC) project and the Xperience administration project.
Tip: There are several possible ways of deploying the project files, including copying over FTP or using the Visual Studio Publish function (with optional precompilation).
Ensure that both applications are registered and configured correctly in the hosting server’s IIS. See also: Manually configuring Xperience applications in IIS
- Make sure that your site and the hosting environment are correctly configured according to Configuring cookie SameSite mode.
Deploy your Xperience database. You can choose between the following approaches:
- Restore a database backup on your hosting SQL server, and manually update the connection string in the web.config file of both projects.
– OR – - Install a new database on your hosting SQL server and use the Xperience Export/import feature to transfer the site:
Delete the connection string from the web.config file of the deployed Xperience administration project.
Open the Sites application on your local development instance and click Export site () next to the site that you want to deploy.
Enter the name of the export package and go through the Site export wizard.
- The system saves the export package into the <administration project>\CMS\CMSSiteUtils\Export folder.
Copy the exported package into the <administration project>\CMS\CMSSiteUtils\Import folder on the hosting server.
Open the administration interface of the deployed project in a browser.
- The application automatically opens the Database installation wizard.
Create a new Xperience database on your hosting SQL server.
At the end of the Database installation wizard, choose to import your existing site (from the previously exported package).
Copy the new connection string from the web.config of the deployed administration project into the web.config of your live site project.
- Restore a database backup on your hosting SQL server, and manually update the connection string in the web.config file of both projects.
Database server time zones
If possible, use the same time zone for both your local environment and the production server hosting your database. Otherwise you may encounter time shift problems with the deployed data, for example in the settings of scheduled tasks.
If you cannot synchronize the time zones, we recommend that you verify and reconfigure the timing settings of scheduled tasks after the deployment.
You may also need to adjust the site’s settings for your production environment:
- Open the Sites application. Edit the site and make sure the presentation URL, administration domain name, and any domain aliases are configured correctly for the production domains.
- Open the Settings application and make sure your site settings contain correct values. For example, the SMTP server setting in the System -> Emails category (you may use a different SMTP server in your production environment).
Your site is now deployed. You can maintain the site and update its content by setting up staging or by manually deploying newer import packages.
Publishing projects from Visual Studio
You can deploy Xperience web projects to your hosting server using the Visual Studio Publish function (MSDeploy).
- Decide whether to precompile the website prior to deployment. See Precompiling websites for more information.
- Open your web project in Visual Studio (using the WebApp.sln file).
- Right-click the CMSApp Xperience project in the Solution Explorer and select Publish.
- Prepare a publish profile according to your requirements. See How to: Deploy a Web Project for details.
- Publish the site.
- Repeat this process for the live site application.
Visual Studio publishes the project according to your profile’s settings – either copies the project’s files to the target server or creates a deployment package.