Available with Standard or Advanced license.
To move a geodatabase from one database server to another, you can detach the geodatabase from one database server and attach it to another, or create a backup of the geodatabase and restore it to another database server.
Before you move the geodatabase, determine which logins own data in the geodatabase and, therefore, need to be present on the destination database server. Also determine where the database file or backup file is located on the source database server.
Transfer data owner logins
When you move a geodatabase using detach and attach or backup and restore, the users, schemas, and data remain in the transferred database. If the logins for the users who own data in the database do not exist on the destination database server, you must add them. If the logins cannot be added (for example, if the database has been moved from one domain to another and the data owners were all domain logins), data will be inaccessible to any users who were not granted access to the data before the database was moved. Therefore, it is a good idea to grant access to the data to the dbo user before moving the database. That way, at least one user can access the data after the database has been moved.
If you are moving the geodatabase between database servers on the same domain, add the logins for the data owners to the destination database server.
Move the geodatabase
Choose one of the following methods to move the geodatabase: detach and attach or backup and restore.
Detach and attach
Detach a geodatabase
Detaching a geodatabase removes all references to the geodatabase from the database server, but it does not delete the data file (.mdf). Once detached, the SQL Server Express data file can be transported and attached to another SQL Server Express instance.
The .mdf file and the full-text catalog for the database are in the directory in which you initially created the geodatabase. For example, if you create a geodatabase in the folder C:\MyData, that is the directory in which you would find the data and full-text catalog files.
When transferring a geodatabase to another server, you do not need to copy the .ldf file; a new one is created on attach. However, you must copy the full-text catalog with the database if one exists. The full-text catalog is in the .ndf file. For the full-text catalog to transfer properly, the database server to which you move the geodatabase must also be set up to use Microsoft SQL Server Full-Text Search.
- Log in as a server administrator, start ArcMap, and open the Catalog window.
- Double-click the database server from which you want to detach the geodatabase.
- On the Catalog Content tab, right-click the geodatabase, and click Detach.
Move the database file
If the database server to which you want to move the geodatabase is on another computer, use Windows explorer to find and copy the .mdf file (and .ndf file, if it exists) from the source computer and paste it onto the destination computer. If you cannot connect to the destination computer from the source computer, use separate media to transfer the files.
Attach the geodatabase
Attaching a geodatabase to a database server registers the data file with the SQL Server Express instance. The geodatabase is added to the server and appears in the Catalog tree.
The attached geodatabase will have the same name as it did on the instance from which it was detached. Therefore, be sure you do not have any other geodatabases with that name on the instance to which you attach the database. If you do, the attach operation will fail because database names must be unique on a SQL Server instance.
When the geodatabase is attached to the database server, the license is updated in the geodatabase. That means if you detach a geodatabase from a database server that was licensed under ArcGIS Desktop or ArcGIS Engine and attach it to a database server that is licensed through ArcGIS Server at the Workgroup level, the license in the geodatabase is updated. See Update license keys for database servers and their geodatabases for information on changing licenses using the attach operation.
You must be a server administrator and a Windows administrator on the machine where SQL Server Express is installed to attach a geodatabase to a database server.
- Log in as a server administrator, start ArcMap, and open the Catalog window.
- In the Catalog tree, right-click the database server to which you want to attach the geodatabase.
- Click Attach.
- On the Attach Geodatabase dialog box, browse to the geodatabase data file you are attaching.
- Click OK.
Back up and restore
You can create a backup of the geodatabase to be moved, transfer the backup file to the destination database server's computer, and restore the geodatabase to the destination database server.