You may need to move an existing Flow instance from one database server (the source server) to another (the destination server). For example:
- Your Flow database server has been migrated/upgraded from one SQL Server node to another. This is not referring to an in-place upgrade, but where you need to move the Flow database from one server to another
- You are a system integrator who has worked offline on the development of a client's Flow Instance and need to move the database from your PC to the production environment
- You need to take a backup of a production Flow Instance and restore it to a QA environment
First, undeploy all the platforms and then make a backup of the Flow Instance database. You could do this using a tool such as SQL Server Management Studio (SSMS), within the Flow Config tool, or using the Flow CLI.
Second, restore the database backup to the destination server. You may need to involve the Database Administrator (DBA) for this task.
If you're using SSMS, right-click on the destination SQL Server's Databases node and select Restore Database:
Select the Device radio button and the ellipses to the right:
When you see the "Select backup devices" window, select Add:
Browse to your database backup file, select it, and select OK:
The backup file you selected will be added to the Backup media list. Select OK:
Select the Backup Set that you want to restore by selecting the check box. Rename the Destination Database to what you want the database name to be on the destination server. By default, this will have the name of the database from your source server. Select OK to commence the database restore:
When the database restore has been completed, a success dialog will display. Select OK to confirm.
Open the Flow Config tool (which ideally is on the latest version) and create a New connection to the Flow Instance database on the destination server (the one you've just restored). After populating the details, select Connect (and not Create, since the database is an existing one):
You will get a message indicating that the license has been reset. The license is reset whenever a Flow instance database is restored or moved from one server to another. You will need to request another license from your system integrator. For now, acknowledge the message to continue by selecting OK:
If the Flow version of your Config Tool is later than that of the Flow Instance database you've restored, you'll get a message asking you whether you want to migrate to the latest version. If the versions are the same, then the Config Tool will open as usual with the Model View displayed.
Another possibility is that a migration is required, but you don't have administrator rights on the Flow Instance - this happens, for example, when you're moving a Flow Instance from a private PC to an organization's domain, and you're using a different user account on the domain. If this is case, you'll get a message similar to the below:
In a situation where you get the above message, the Config Tool will close after you select OK. You'll need to get (e.g. from a DBA), or give yourself (assuming you've been granted rights on the SQL Server to do so), administrator rights on the Flow Instance. To do this, use SSMS to navigate to the Flow database on the destination server, right-click on the database node and select New Query:
Run the following query:
select * from Username
select * from GroupsUsername gu
join Groups g on gu.GroupID = g.GroupID
Look through the results to identify two IDs:
1. The UsernameID associated with your user account
2. The GroupID associated with the Administrators group
Once you have those two values, run the following Insert command on the Flow database, being sure to replace the GroupID and the UsernameID with the correct values. In the example below, the GroupID is 1 and the UsernameID is 2:
insert into GroupsUsername (GroupID, UsernameID) values (1, 2)
Open the Flow Config tool again and connect to the restored Flow Instance database (the details should be cached from when you connected to it earlier). Select Connect:
Now, because you have Administrator rights, you'll get a message with the option to migrate to the later version of Flow. Select Yes:
You'll also be asked whether you'd like to backup the database before migrating. Under most other circumstances, this would be recommended. However, since you've just restored from a backup (which you should still have!), you're safe to select No:
The migration will commence, and the progress bar at the bottom of the dialog will update you on the progress:
When the migration completes, the Config Tool will open the Model View. However, if you don't have connectivity to any of the Flow platforms that are configured in the Flow Instance (such as if you're moving the instance from your private PC to an organization's domain), you will get a warning similar to the one below. This is not a major problem - we will fix this in the next steps. Select Ok:
The Config Tool will open its default layout, with the Model View on the left. Open the Deployment View tab. Rename any platforms that need to be updated by right-clicking on their nodes and renaming them. For example, you may need to rename the platform from your laptop name to the name of the production server where you will be running the Flow platform/s.
Also, now is a good time to modify any System Properties by selecting System > Properties. For example, if the Bootstrap Port is different in the new environment, or if the Flow components need to use SQL Authentication, you'll need to update these in the System Properties.
Once you're done, close the System Properties windows. To commit any changes that you've made select System > Connect to reconnect to the Flow instance:
This will re-open the standard Connect dialog which you've used earlier to connect to the Flow Instance. Select Connect and the Config Tool will refresh/re-open. Now, we need to get a new license because it was reset during the database move. Go to Help > License:
This will open the License dialog:
Select the Copy Details button. Paste the details into an email to your software provider requesting an updated license. You will need to tell them which site the license is for. Also, it might be best to first paste the license details into a text editor like Notepad, and then copy and paste from their into your email editor.