KLYRN
KLYRN Web
All documentation
  1. Home
  2. Docs
  3. From DirectAdmin

DirectAdmin to KLYRN

KLYRN reads a DirectAdmin server with one command and turns what it finds into a plan you approve. Each site moves with a pre-copy while the source keeps serving. Read what to expect first. It needs a Pro, Business or Enterprise licence. Copying a single site over SSH works on every edition.

Read this before anything else

Run on a production DirectAdmin 1.697 server over SSH. 40 accounts, 48 domains, 25 databases and 48 mailboxes were copied and verified, and the source was only read. The backup-file route has been tested against archives built from DirectAdmin's documented layout. No archive from a real DirectAdmin server has been through it yet.

DirectAdmin does not publish four formats. KLYRN says so when it relies on one:

  • <domain>.subdomains: one label per line is assumed.
  • <domain>.pointers: three shapes are parsed. Every alias read from it carries the warning “whose format DirectAdmin does not document; it is treated as an alias. Check it”.
  • user.usage: an absent key is reported as not measured, never as zero.
  • The backup tarball's internal layout. Only its naming, location and compression are documented.

Keep the old server running, and look at the copy here before you touch DNS.

Before you start

An SSH login to the source
Root, or sudo without a password, migrates every account. Any other login migrates only what it owns. Keys and free space.
The SSH port
22 by default. Anything from 1 to 65535.
Two readable files on the source
/usr/local/directadmin/custombuild/options.conf resolves each domain's PHP version. /usr/local/directadmin/conf/my.cnf lists the databases.
Mail hosting turned on, if the mail is coming too
Mail is a separate step after the site exists.

There are two ways in:

The live server, over SSH
One website at a time, from Migrate in the panel or from the CLI.
klyrn import ssh --host old.example.com --user root --domain acme.com
With a root login, Migrate reads the whole server in one pass. Take everything, some accounts, or some sites.
A DirectAdmin user backup
One account, one pass, no pre-copy and no delta.
klyrn import directadmin /root/user.acme.tar.gz

What migrates

Accounts and their domains
The walk reads /usr/local/directadmin/data/users: every account with its domains, subdomains and pointers. It runs at lower CPU and IO priority where the source has the tools.
A PHP version per domain
php1_select=2 resolves through custombuild/options.conf as php2_release=8.1. An account with 8.2 on one domain and 5.6 on another keeps both.
Files and application credentials
As on every SSH route.
Databases
Listed through conf/my.cnf with --defaults-extra-file. The da_admin password never leaves the source.
Scheduled tasks, with one exception
Root's crontab is not read, so a migration run as root carries no cron entries. The inventory counts each account's entries.

A version this server does not offer is warned about before anything moves: “runs PHP 8.6, which this server does not offer. The nearest is 8.5: close, but not the same interpreter, so test the site before you cut over.” A tie goes to the older version. A slot that cannot be resolved stays unknown.

PHP past end of life is offered: 5.6, 7.0 to 7.4, 8.0 and 8.1. They no longer receive security fixes.

An archive is read from this layout:

backup/user.conf                 username=, domain=, email=, package=, ip=
backup/crontab.conf              <id>=<schedule> <command>
backup/<user>_<db>.sql           one dump per database
backup/<user>_<db>.conf          <dbuser>=passwd=<hash>&accesshosts=localhost
backup/<domain>/<domain>.db      the zone, read for the record
backup/<domain>/email/passwd     mailboxes: counted, never migrated
domains/<domain>/domain.conf     php1_select=, ssl=
domains/<domain>/public_html/    the document root
domains/<domain>/subdomain.list  one subdomain label per line
domains/<domain>/pointers.conf   <alias>=alias|pointer

A database user whose stored hash begins with * keeps that hash. Any other password is replaced with a generated one, and the job log names the user.

What does not migrate

The site migration leaves mail on the source. The plan lists the count: “996 mailbox(es) and 497 forwarder(s) are NOT part of this migration and stay on the source. When it finishes, it finishes as Complete with warnings, not Complete.”

With mail hosting on, a separate step copies mailboxes with their passwords, forwarders and the catch-all over SSH. Autoresponders are named in the job log and not copied. MX records are not touched.

The plan also lists what is read and not taken:

  • FTP accounts. KLYRN uses SFTP with the account's own login.
  • DNS zones. DirectAdmin's nameservers keep answering until you move the delegation.
  • Reseller limits and packages. Accounts keep their owner in the inventory.
  • Web server customisations: .cust_apache, .cust_nginx and .cust_httpd.
  • Certificates from the archive. KLYRN issues its own.
  • The DirectAdmin version. Run da version on the source yourself.

Downtime

Over SSH the downtime is the final sync. The two passes and the WordPress freeze are those of every SSH route.

klyrn import sync <id>
Final sync of import #7 (job #31). Its wall time is the downtime.

The archive route has no second pass. Anything written on the source after the archive was made is not in it.

Checks and refusals

The connection check and host key pinning are those of every SSH route. A DirectAdmin source adds two results:

What can be read
Names whichever of options.conf and conf/my.cnf this login cannot read. PHP versions or databases will then be missing from the inventory. Connect as root.
What will not be migrated
Mail is counted and stays on the source.

Two more things are decided when you press Start:

  • A site that already exists here. “3 of the selected sites already exist here: ”. One unresolved collision stops the whole migration.
  • A database name that is taken. The plan gives it a suffixed target name.

A database no site's configuration named is attached to the account's main site. The plan names it, so you can move it.

Cut-over

Follow the cut-over of every SSH route, with four changes:

  • Decide about mail first. If it is coming here, turn mail hosting on, bring it across, check it, and then point MX here. If it is staying, leave MX alone.
  • Check mail again afterwards. The verification marks an MX record pointing at this server as action required and names it.
  • Keep the old server for a week. The mailboxes are still on it.
  • An archive import has no final sync. Its window runs from the archive being made to DNS moving.

Rollback

KLYRN never deletes or suspends anything on the source. Nothing is installed on it either.

Point DNS back at the old server. It has every file and mailbox it had before.

klyrn import delete <id> removes the migration record and its working files. It leaves the sites and databases the migration created, and any archive you supplied by path. Nothing exists on this server until apply.

Troubleshooting

“the database server would not accept DirectAdmin's own credentials, so no database is listed. This is NOT the same as having no databases.”
Connect as root, or check that conf/my.cnf is readable and its credentials still work.
A domain resolved to no PHP version
options.conf could not be read, the slot has no php<N>_release, or it reads php<N>_release=no. The plan names the domains, which get this server's default.
An archive refused as not safe to extract
See the archive check. Get a fresh archive from the source panel.
Anything else over SSH
See troubleshooting over SSH.

What “verified” proves, and what it does not: What to expect.

Discord WhatsApp