Download Importing of External Databases

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Plesk
CHAPTER 1
Importing of External Databases
In this chapter:
Introduction ....................................................................................................... 3
Restoring Database Dumps .............................................................................. 4
Importing of External Databases
3
Introduction
Plesk 12.1 offers enhanced functionality to restore database dumps that were created
on any external Microsoft SQL Server.
After restoring such dumps to the production SQL Server, users could not access
restored databases from Plesk because of the problem with orphaned users. Database
user accounts in such dumps are associated with logins that exist on external servers.
To make a restored database operable, it is necessary to associate its database user
with a system administrator login on the production server. However, Plesk is unable to
change associated logins due to insufficient rights.
To avoid this, you will use a sandbox SQL Server, where database dumps will
automatically have orphaned users repaired before restoration to production SQL
Servers.
Servers involved
The following servers take part in the task of restoring dumps from an external SQL
Server:

A production SQL Server (local or remote).

A local server with Plesk and with the production SQL Server registered in Plesk.
Plesk uses a login with privileges less than system administrator to connect to
production SQL Servers.

A sandbox SQL Server (local or remote). Plesk must use a system administrator
login to connect to the sandbox server. For details on how to create a sandbox
server and register it in Plesk, see Restoring Database Dumps on the next page.
Restrictions
The production and the sandbox SQL Servers must be of the same major version.
Initial dumps can be created on SQL Servers of the same or an earlier major version
than the production and sandbox SQL Servers.
Prerequisites
If the production SQL Server is located on a remote host, make sure you properly
configured its backup settings in Tools & Settings > Database Servers. For details about
the backup settings, see the Administrator’s Guide, Configuring Backup Settings for
Remote SQL Servers.
4
Importing of External Databases
Restoring Database Dumps
 To restore a database dump from an external SQL Server:
1. Add the following setting in panel.ini:
[databaseManagement]
features.useSandboxMsSQLServer = on
This setting makes it possible to register a sandbox server in Plesk.
2. Set up a sandbox SQL Server. It can be either on the local server or on a remote
host.
3. Register the sandbox server in Plesk by using the --set-sandbox-mssqlserver command of the database-server utility.
Important: If the sandbox SQL Server is located on a remote host, specify backup
settings for this server. Use the --set-sandbox-mssql-server command of the
database-server utility.
For example:
C:\Program Files (x86)\Parallels\Plesk\admin\bin>databaseserver.exe --set-sandbox-mssql-server
10.52.173.168\MSSQLSERVER2014 -admin sa -passwd 12345 -dbserver-temp-backup-dir “C:\ PrivateTemp” -db-server-networkbackup-dir “\\A10-52-173-168\PrivateTemp” -db-server-networkbackup-usr 10.52.173.168\Administrator -db-server-networkbackup-pwd 67890
The command --set-sandbox-mssql-server takes the following options:
-admin
The login for accessing the sandbox SQL
Server.
Set the database owner to the same login
as the one used production Plesk server.
-passwd
The user password for accessing the SQL
Server.
-db-server-tempbackup-dir
The path to a physical folder on the remote
server where the sandbox SQL Server is
located. The sandbox SQL Server must be
able to access this folder for reading and
writing temporary backup files.
For example, C:\DirectoryPath
-db-server-networkbackup-dir
The path to the network share of the folder
specified above. The network share should
be mapped to that physical folder. Plesk will
access the shared folder to download and
upload backup files.
For example,
\\ServerName\DirectoryPath
-db-server-network-
The username of a network user created on
Importing of External Databases
backup-usr
5
the remote server. For example,
\\ServerName\UserName.
The user must have access to the shared
folder specified in -db-server-networkbackup-dir.
-db-server-networkbackup-pwd
The network user\’s password.
4. Plesk subscription users can import dumps to the production SQL Server in
Websites & Domains > Databases > select a database > Import Dump.
Note: If a sandbox server is registered in Plesk, any database dump will be imported
via the sandbox server.
When Plesk users import database dumps, Plesk automatically performs the following
actions:
1. Restores the dump to the sandbox server and checks the limits on the database file
size and database log file size. If the limits are not exceeded, Plesk performs
further steps.
2. Changes the database owner in the dump: sets it to the same login as the one used
on the production server. This measure prevents the database user becoming
orphaned after restoration on the production SQL Server.
3. Creates a backup of the database after it was processed on a sandbox.
4. Restores the backup to the production SQL Server.
5. Removes the database from the sandbox server.
 To un-register a sandbox server from Plesk:
Run the command:
database-server.exe --remove-sandbox-mssql-server