Move enterprise geodatabases in SQL Server between AWS instances
In this topic
- When would you use this method to move data?
- Stop web services
- Detach database
- Start new instance
- Delete existing database
- Move database and transaction log files
- Attach database and transaction log files to new instance
- Add users to database, if required
You can move an existing enterprise geodatabase in SQL Server from one ArcGIS Server on Amazon Web Services instance to another by detaching the database files and transaction logs from one SQL Server instance, moving them to the target ArcGIS Server on Amazon Web Services instance, and attaching them to the new SQL Server instance.
Note:
This workflow does not apply to Amazon Relational Database Services for SQL Server.
When would you use this method to move data?
You might use this method if you created a new ArcGIS Server on Amazon Web Services instance and you want to move a geodatabase from your existing instance (the source instance) to the new instance (the target instance).
Moving individual geodatabases in SQL Server between instances of ArcGIS Server on Amazon Web Services is relatively simple as long as you haven't added custom logins to the SQL Server instance.
If you plan to move one of the default geodatabases (egdb or geodata), you must delete the corresponding geodatabase from the target instance. Database names on an instance must be unique, and geodatabases cannot be renamed. If the geodatabase on the target instance contains data, you should not use this method to move the geodatabase.
Stop web services
There cannot be any active connections to a database if you want to detach it. Therefore, you must stop the services that use data in the database before you detach the database from the existing instance.
- Open ArcGIS Server Manager for your existing ArcGIS Server on Amazon Web Services instance.
- On the Services page, choose the services that are connected to the database you want to detach and click Stop.
Detach database
Use SQL Server Management Studio to detach the database.
-
Make a remote desktop connection to your existing instance.
You must open the RDP port in your security group to make remote desktop connections. You can remove this rule from your security group after you move your data.
- If your SQL Server instance is on the same machine as ArcGIS for Server, connect to your ArcGIS for Server (SITEHOST) instance.
- If your SQL Server instance is on a different machine, connect to that (EGDBHOST) instance.
- Start SQL Server Management Studio.
- Log in to your SQL Server instance using operating system authentication.
- Expand the Database folder.
- Right-click the database, point to Tasks, and click Detach.
- Choose which options you want and click OK.
Start new instance
If the destination ArcGIS Server on Amazon Web Services instance to which you want to transfer the database has not yet been created, follow the instructions in Build an ArcGIS server site on Amazon Web Services to create your new site.
Delete existing database
If your ArcGIS Server on Amazon Web Services instance includes an enterprise geodatabase server, it comes with two geodatabases: egdb and geodata. If the geodatabase you are moving to the target ArcGIS Server on Amazon Web Services instance has the same name as one of these, you must delete the existing geodatabase before you can attach the one you moved.
Caution:
Do not do this if the geodatabase on the target instance contains data that is still needed. If your destination instance already has a geodatabase of that name that contains data, you must use a different method to move your data from one instance to another; geodatabases cannot be renamed.
Delete the databases in SQL Server Management Studio on the new ArcGIS Server on Amazon Web Services instance.
-
Log in to the target ArcGIS Server on Amazon Web Services instance using remote desktop and the operating system Administrator login.
You must open the RDP port in your new security group to make remote desktop connections. You can remove this rule from your security group after you move your data.
- If your SQL Server instance is on the same machine as ArcGIS for Server, connect to your ArcGIS for Server (SITEHOST) instance.
- If your SQL Server instance is on a different machine, connect to that (EGDBHOST) instance.
- Start SQL Server Management Studio.
- Log in to your SQL Server instance using operating system authentication.
- Expand the Database folder.
- Right-click the database that has the same name as the database you want to attach and click Delete.
- Click OK on the Delete Object dialog box to drop the database.
Move database and transaction log files
You must move the detached database (.mdf) and log files (.ldf) from the source instance to the target instance. See Strategies for data transfer to Amazon Web Services for ways to move files to your ArcGIS Server on Amazon Web Services instance. Be sure to place the files on the data volume, not the C drive of the target instance.
Attach database and transaction log files to new instance
Use SQL Server Management Studio to attach the files to the new SQL Server instance.
- If you closed Management Studio, restart it and log in to your target instance.
- Right-click the Database folder and click Attach.
- Click Add on the Attach Databases dialog box.
- Browse to the location of your database file on the target ArcGIS Server on Amazon Web Services instance.
- Choose the .mdf file and click OK.
- Click OK to attach the database.
If the database doesn't appear in the list, refresh the Database folder.
Add users to database, if required
If you moved your geodatabase from another ArcGIS Server on Amazon Web Services instance, the database already contains the users needed for ArcGIS. If you had added other logins and users to your source instance and database, and those users own data, you must add the same logins to the new SQL Server instance. If you are using SQL Server-authenticated logins, you might need to synchronize SIDs. See the SQL Server documentation for information on creating and synchronizing logins and users.