Migrating the CloudPanel Database and/or the IIS application to a new server is an easy process and following most of the same procedures as installing a new instance but with some minor changes.
To migrate the SQL database, simply use the SQL Server Management Studio to backup the database. Right click on the SQL database, choose Tasks -> Backup. Enter a local path to save the .BAK file to, then select "Media Options". Make sure you check "Verify Backup when finished":
Once the backup is complete and verified, copy the .BAK file to the new SQL server and follow the same steps but this time right click on the Database folder and choose "Restore Database"
Follow the same procedures for prepping the new server with IIS and ASP.NET 4.x+ that you did when you originally installed CloudPanel. Once the server is prepared, launch the CloudPanel installation wizard and enter the same IIS application pool information you used on the old server.
When you reach the SQL database section, check the "Skip database configuration" checkbox located at the bottom of the window. This tells the installer to not to create a new SQL database and completely skip any database configurations.
Next, you must update the settings.xml file located in C:\Program Files (x86)\KNow More IT\CloudPanel\config. You can either manually edit this file or copy the settings.xml from the old server and update the location if you moved the database.
This file contains the SQL connection string to point it to the new server.
The CloudPanel branding stores local files for branding such as the logo, report logo, etc. You need to copy C:\Program Files (x86)\Know More IT\CloudPanel\content\img\branding folder and merge it with the new folder created on the new server.
If you use the documentation module in CloudPanel, you will want to copy this folder as well and merge it with the directory on the new server.
Now it is time to test, go to IIS and stop the IIS application pool named CloudPanel. Wait about 15-30 seconds and start it again. Login to CloudPanel and verify everything is working.
CloudPanel has the ability to import existing objects in Active Directory and Exchange into the CloudPanel database so you can manage.
Before performing these steps there are important things to note to make sure you have a functioning environment.
Important
CloudPanel will only import the values currently in Active Directory into the database and will not modify anything on the backend. If you are migrating from another control panel you will need to make sure the backend is ready and correct before importing. Compsys/Know More IT is not responsible for any issues that arise from an improper import process.
You can import companies in Active Directory into the CloudPanel database by going to: /CloudPanel/import/[ResellerCode]
Before importing the companies you must make sure the organizational unit is located in the reseller organization unit that is under the Hosting OU you specified in the CloudPanel settings.
Make sure the uPNSuffixes attribute on the company’s organizational unit contains the domains that are part of the company. If you forget to do this then it will result in an error.
There are some important things to note when importing companies:
You can import users from Active Directory into the CloudPanel database by going to: /CloudPanel/company/[CompanyCode]/import/users
When importing users you must make sure that the users are already configured properly on the backend. CloudPanel will just read the data from the Active Directory user and place it in the database without making any modifications to Exchange or anything else on the backend.
Important notes about importing users:
Notice
In order to access this page you need to create an Exchange archiving plan even if you do not plan on using archiving. Failure to do this will result in a 500 error and the page not loading correctly.
You can import other objects into CloudPanel by browsing to: /CloudPanel/company/[CompanyCode]/import
Any object you import will need to already be configured on the backend proeprly. Skipping this step will cause an unstable environment.
Important
If you need assistance with importing or migrating to CloudPanel then please contact support.
There may come a time where you need to move a customer to a new reseller for a various reasons, but CloudPanel doesn’t provide an option to move the company for you. We decided against writing this in CloudPanel due to the amount of problems that could arise if everything wasn’t moved properly, which is why we prefer doing manually.
WARNING
Not following these instructions right could result in CloudPanel issues. If you do not feel comfortable with performing these steps, then please contact us. Make sure that you backup your CloudPanel database BEFORE starting. We HIGHLY recommend that you create a test company and practice moving that company to a new reseller before an actual production company.
Since we will be making modifications in SQL manually, please be sure to backup the sql database and choose the option to verify the backup. We are not responsible for any lost data, so PLEASE be sure to backup your database!
It is important to gather all of the information ahead of time. During this example we will be using SQL Management Studio to interact with SQL server.
The first thing we will need to do is move the company’s organizational unit. In this example going forward we will be moving a company with the code ‘COM‘ that is under the reseller with code ‘LAB‘ to a new reseller that has a code of ‘TEN‘. These are just examples and does not match your environment. You need to replace the appropriate codes with the ones you are moving in YOUR environment.
Now that you have moved the organizational unit in Active Directory, CloudPanel will no longer be able to manage this company for you. So we now need to go into SQL Server Management Studio and update the sql tables. To do this, please open SQL Server Management Studio, click on New Query, and make sure you select your CloudPanel database from the dropdown.
First thing we need to do is update the company to be under the new reseller. Change the ResellerCode value to your NEW reseller and the CompanyCode value to your company in the script below before executing:
UPDATE cp_Companies SET ResellerCode='TEN' WHERE CompanyCode='COM'
Now that we have changed the reseller association for that company in the database, you should see it listed under the proper reseller in CloudPanel. However, there are still other objects we need to migrate. Next, we need to update the user’s distinguished name:
UPDATE cp_Users SET DistinguishedName=replace(distinguishedname, 'OU=LAB', 'OU=TEN') WHERE CompanyCode='COM'
Notice in the command above that OU=LAB contains the old reseller code “LAB” and we are replacing it with the new reseller code “TEN”.
Update the security groups that are stored in CloudPanel
UPDATE ad_SecurityGroups SET DistinguishedName=replace(distinguishedname, 'OU=LAB', 'OU=TEN') WHERE CompanyId=(SELECT ID FROM cp_Companies WHERE CompanyCode='COM')
Notice in the command above that OU=LAB contains the old reseller code “LAB” and we are replacing it with the new reseller code “TEN”.
Next is to update any Exchange mail contacts you may have:
UPDATE exch_Contacts SET DistinguishedName=replace(distinguishedname, 'OU=LAB', 'OU=TEN') WHERE CompanyCode='COM'
Notice in the command above that OU=LAB contains the old reseller code “LAB” and we are replacing it with the new reseller code “TEN”.
Next is to update any Exchange distribution groups you may have:
UPDATE exch_DistributionGroups SET DistinguishedName=replace(distinguishedname, 'OU=LAB', 'OU=TEN') WHERE CompanyCode='COM'
Notice in the command above that OU=LAB contains the old reseller code “LAB” and we are replacing it with the new reseller code “TEN”.
If you have any public folder mailboxes then those will have to be updated as well:
UPDATE exch_PublicFolderMailboxes SET DistinguishedName=replace(distinguishedname, 'OU=LAB', 'OU=TEN') WHERE CompanyID=(SELECT CompanyId FROM cp_Companies WHERE CompanyCode='COM')
Notice in the command above that OU=LAB contains the old reseller code “LAB” and we are replacing it with the new reseller code “TEN”.
Update any resource mailboxes that you may have:
UPDATE exch_ResourceMailboxes SET DistinguishedName=replace(distinguishedname, 'OU=LAB', 'OU=TEN') WHERE CompanyCode='COM'
Notice in the command above that OU=LAB contains the old reseller code “LAB” and we are replacing it with the new reseller code “TEN”.
Once everything is moved, please login to CloudPanel and make sure you can access all of the objects. If you had any custom scripts or third party options that may have bound to a specific distinguished name, then those will not be working because we essentially changed the distinguished name in Active Directory by moving the organizational unit to a new path. There are some other possible third party integrations that we know about that will break because of this: