User import in ISPmanager 5 before version 5.62

From ISPWiki
Jump to: navigation, search

  • User import from a remote ISPmanager 4 server is supported in ISPmanager 5 Lite5.17.0 and later, ISPmanager 5 Business 5.20.0 and later
  • Import from ISPmanager 4 user's archive is supported in ISPmanager 5 Lite 5.17.0 and later, ISPmanager 5 Business 5.21.0 and later
  • Import from a remote ISPmanager 5 Lite server is supported in ISPmanager 5 Lite and Business 5.20.0 and later

This article walks you through the steps you need to complete to import users from various source servers. This feature is available for Unix-based systems.

Selecting a source for data import

Administrator of the control panel can import data from a remote server running ISPmanager 4.

Import from a remote server with ISPmanager 4

Provide the access details to the remote server with ISPmanager 4. You can find hints for each field.

Both administrator and user can import data from the archive in ISPmanager 4.

Import from the ISPmanager 4 archive file

Enter the path to the archive file that is already uploaded to the server.

Administrator of the control panel should enter the absolute path to the archive file, users - the relative path.

If you are importing data with user permissions, the archive file must locate in user home directory (or in its subdirectories).

The target user must have permissions to read the archive file.

Importing from a remote server with ISPmanager 4

Notes: hereinafter the "source" server is the server from which you are importing users, "target" is the the server to which you are importing.

Importing data requires considerable attention and care. Read the following information that you should know before you start your import

  • The source and target control panels must have the same functionality. For example, if PHP is active in the the web-domain's properties on the source server, the corresponding PHP mode must be selected on the target panel. If mail domains are configured in the source control panel, they must be configured in the target panel as well, etc.
  • Root privileges to access the target panel
  • Root privileges to access ISPmanager 4 on the source server.
  • SSH access to the source server with the above privileges.
  • Users on the source that you are going to import must have shell access.
  • rsync (port) on the source and target.
  • External name servers on the source server must be configured on the target.

Clicking "Next" on the first Wizard step will check the privileges by trying to log into the panel and get a list of ISPmanager 4 users on the remote server.

Provide import parameters on the second Wizard step.


Import parameters from the remote server with ISPmanager 4


Fill out the form:

  • Select users you want to import
  • Provide IP addresses that will be assigned to the domain names and web-domains
  • If you want to delete existing settings ans user files on the target server, select the check box "Overwrite data". Otherwise if the imported data match the data on the target server, they will be skipped.

Important notes You cannot import disabled users, that's why the import wizard will activate them on the source server. The background task that the wizard runs for each user, will disable the user on the source server once the import is complete. If an error occurs when disabling the user, the corresponding notification will be generated on the target server.

Clicking "Next" will import user settings

User settings import:

  • A user is created on the target server if it does not exists . His privileges will be copied from the source server. If the user already exists, its parameters will not change.
  • Domain names are created. Their names are copied from the target server, IP-addresses will be taken from the import parameters.
  • SSL certificates are copied and registered on the target server.
  • Web-domains including redirects and error codes are created.
  • Mail domains are created
  • Mailboxes are created
  • FTP-users are created
  • Cron jobs are created

The wizard will disable the imported users on the target server after import, start a background task for each user to copy databases and files from the corresponding home directories. The background tasks will activate the corresponding users in the target panel.

On the third step you will see information about errors that occurred while mporting user parameters, and statistcial information.

Errors occurred while importing user parameters

Background tasks

Import of database parameters:

  • The source panel creates the database dump and saves it into the temporary file of the user home directory on the target server.
  • The target panel creates a database, imports the dump from the temporary file and deletes the temporary file.

The 'rsync' utility copies the target files using temporary files through SSH. A pair of keys is created on the target server, the open key is registered on the target server with corresponding privileges, and files are copied from the source server into the target. Files are copied with privileges of the corresponding user on both source and target server.

Error notifications will be registered if errors occur while importing databases and user files (The modue Statistics--Notifications).

Importing from the archive file of ISPmanager 4 user

Attention! You can import only one user from archive. The archive must be created in ISPmanager by this user.

Enter required information on the second step.

  • Select a user to import data from archive file. The field "Local user" is available only for administrator of the control panel.
  • Enter IP addresses that will be assigned to the web-domains and domain names.
  • If you want to overwrite settings and files of the users that already exist on the target server, select the check box "Overwrite data". Otherwise, the imported data, which match the data on the target server will be skipped.

Importing user parameters from the archive is performed in the same way as importing parameters from a remote ISPmanager 4 server. After the import process is complete, new databases will be created, dumps from the archive will be uploaded and user files will be extracted . This process may take a long time.

Special aspects of importing data from ISPmanager 4 archive file

Web-domains are created based on data in the archive, for which web-domain's root directory relative to user's home directory is not specified. That's why the web-domain's root directory is specified by default. If files of the web-domain were located in a different directory, you need to move them to the newly created web-domain's directory once the import is complete.

Special aspects of importing data from ISPmanager 4 into ISPmanager Business

Both administrators and users can import data.

If you are importing with administrator permissions, the file archive must locate on the master-server (where the control panel is installed).

If you are importing with user permissions, the file archive must locate in the user home directory on the cluster node where the main user role (web-server) is located. All user files are located on this cluster node.

Restrictions for user import

  • Access permissions to the control panel's modules cannot be imported. To successfully import the settings, the user must have access privileges to the corresponding modules in both ISPmanager 4 and ISPmanager 5
  • Domain records cannot be imported. Domain names are created on the target server with the IP addresses specified in the import parameters. If slave name servers are configured on the target, they will get requests for deletion of the corresponding zone and creation of new ones with new records.
  • The encoding specified for a web-domain will be imported only if it is supported in ISPmanager 5.
  • Names of database server on the source and target must be the same.
  • Databases on the source database servers that are connected remotely, cannot be copied. After import, you will have to manually connect the corresponding database servers and databases.
  • Passwords for users, mailboxes, FTP-users are not imported from the source. A strong password will be randomly generated for them. Such passwords are not shown, so you need to change them before you start.
  • Cron jobs, which command line starts with '/usr/local/ispmgr/', cannot be copied.
  • Files from mailboxes might be inaccessible for users on the source panel due to peculiarities of ISPmanager 4. rsync will show the error message when trying to copy such files, the corresponding notification will be generated. To avoid this, enable a user group with privileges to read thr files.
  • Mailbox filters and auto-responders cannot be imported.
  • Database names cannot start with 'test_'
  • If you are importing into ISPmanager 5 Business, the username cannot be 'test' or start with 'test_', 'test.', 'test-'

Known issues

Error copying files (rsync: opendir ... failed)

The attempt to complete the background task to import user's databases and files from a remote servers fails and generates the notifications "Failed to copy user files".

Clicking "More info" you will show something like this:

"rsync: opendir "/var/www/<username>/data/email/<mail domain name>/<mail domain name> /.maildir" failed: Permission denied (13)rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1536) [generator=3.0.9]"

meaning that the user does not have permissions to access the specified directory on the source server and the directory could not be copied.

Solution

Change access permissions to the specified directory on the source server. The user you are going to import will have permissions to read and get contents of that directory and its elements.


Error copying files (rsync: ssh exec failed: permission denied)

The attempt to complete the background task to import user's databases and files from a remote servers fails and generates the notifications "Failed to copy user files".

Clicking "More info" you will show something like this:

"rsync: ssh exec failed: error code 13 ... ... ..."

meaning that rsync started with permissions of the user you are going to import, cannot be started via ssh due to access permissions.

Solution

As a rule, SElinux (if you run CentOS) restricts access. Enable SElinux on the target-server.

Importing large databases (> 2GiB) from a remote server

Getting large amounts of data through HTTPS might be very unstable, that's why we recommend that you import large databases manually. You need to create a database dump archive in the user home directory and upload the dump on the target server, once the import process is complete.