cpainl creates a compressed archive for individual accounts. To restore/import a domain/account to a non-cpanel system, decompress (uncompress?) the archive and take a look at the file structure therein:
total 96K
drwx------. 2 ilmostro 6 Aug 21 03:02 bandwidth
drwx------. 2 ilmostro 6 Aug 21 03:02 bandwidth_db
drwx------. 2 ilmostro 6 Aug 21 03:02 counters
drwx------. 2 ilmostro 19 Aug 21 03:02 cp
drwx------. 2 ilmostro 6 Aug 21 03:02 cron
drwx------. 2 ilmostro 26 Aug 21 03:02 dnszones
drwx------. 4 ilmostro 33 Aug 21 03:02 domainkeys
drwx--x--x. 19 ilmostro 4.0K Aug 21 03:02 homedir
drwx------. 2 ilmostro 6 Aug 21 03:02 httpfiles
drwx------. 2 ilmostro 24 Aug 21 03:02 ips
drwx------. 2 ilmostro 6 Aug 21 03:02 locale
drwx------. 2 ilmostro 99 Aug 21 03:02 logs
drwx------. 2 ilmostro 93 Aug 21 03:02 meta
drwx------. 2 ilmostro 6 Aug 21 03:02 mm
drwx------. 4 ilmostro 27 Aug 21 03:02 mma
drwx------. 2 ilmostro 6 Aug 21 03:02 mms
drwx------. 2 ilmostro 4.0K Aug 21 03:02 mysql
drwx------. 2 ilmostro 67 Aug 21 03:02 mysql-timestamps
drwx------. 2 ilmostro 6 Aug 21 03:02 psql
drwx------. 2 ilmostro 22 Aug 21 03:02 resellerconfig
drwx------. 2 ilmostro 6 Aug 21 03:02 resellerfeatures
drwx------. 2 ilmostro 6 Aug 21 03:02 resellerpackages
drwx------. 2 ilmostro 6 Aug 21 03:02 ssl
drwx------. 2 ilmostro 4.0K Aug 21 03:02 sslcerts
drwx------. 2 ilmostro 4.0K Aug 21 03:02 sslkeys
drwx------. 2 ilmostro 6 Aug 21 03:02 suspended
drwx------. 2 ilmostro 6 Aug 21 03:02 suspendinfo
drwxr-xr-x. 2 ilmostro 6 Aug 21 03:02 userconfig
drwx------. 2 ilmostro 96 Aug 21 03:02 userdata
drwx------. 2 ilmostro 47 Aug 21 03:02 va
drwx------. 2 ilmostro 47 Aug 21 03:02 vad
drwx------. 2 ilmostro 47 Aug 21 03:02 vf
-rw-------. 1 ilmostro 0 Aug 21 03:02 addons
-rw-------. 1 ilmostro 41K Aug 21 03:02 bandwidth_db.json
-rw-------. 1 ilmostro 0 Aug 21 03:02 digestshadow
-rw-r--r--. 1 ilmostro 0 Aug 21 03:02 has_sslstorage
-rw-------. 1 ilmostro 13 Aug 21 03:02 homedir_paths
-rw-------. 1 ilmostro 1.5K Aug 30 06:09 mysql.sql
-rw-------. 1 ilmostro 0 Aug 21 03:02 nobodyfiles
-rw-------. 1 ilmostro 0 Aug 21 03:02 pds
-rw-r-----. 1 ilmostro 350 Apr 20 03:28 proftpdpasswd
-rw-------. 1 ilmostro 1 Aug 21 03:02 quota
-rw-------. 1 ilmostro 18 Aug 21 03:02 sds
-rw-------. 1 ilmostro 48 Aug 21 03:02 sds2
-rw-------. 1 ilmostro 106 Aug 21 03:02 shadow
-rw-------. 1 ilmostro 31 Aug 21 03:02 shell
-rw-------. 1 ilmostro 0 Aug 21 03:02 ssldomain
-rw-r--r--. 1 ilmostro 39 Aug 21 03:02 version
For the most part, a lot of the directories and/or files can be ignored, unless you want to import everything; i.e. cron
, mail, bandwidth usage, etc.
Arguably, the main items, in most scenarios, pertain to the database, dns, and apache. Therefore, focus should be on the following files/folders:
drwx------. 2 26 Aug 21 03:02 dnszones
drwx------. 4 33 Aug 21 03:02 domainkeys
drwx--x--x. 19 4.0K Aug 21 03:02 homedir
drwx------. 2 4.0K Aug 21 03:02 mysql
drwx------. 2 4.0K Aug 21 03:02 sslcerts
drwx------. 2 4.0K Aug 21 03:02 sslkeys
drwx------. 2 96 Aug 21 03:02 userdata
-rw-------. 1 1.5K Aug 30 06:09 mysql.sql
-rw-------. 1 18 Aug 21 03:02 sds
-rw-------. 1 48 Aug 21 03:02 sds2
The userdata directory made it in there because it has some useful reference items for the configuration; similar reasons for the sds and sds2 files.
Make any necessary changes to the files, paying attention to the old IPs in particular!
Database
Then create the specific database. Repeat for additional databases, depending on the domains, files, databases. dbname.create file also creates the necessary users and give them the necessary privileges on the databases.
# mysql < mysql/yourdomain_database.create
Import the database like so:
# mysql yourdomain_database < mysql/yourdomain_database.sql
DNS
# cp -v dnszones/*.db /var/named/
Copying over the DNS zone files to your dns server, if applicable. Make sure to adjust the necessary DNS server configuration to include the zone files; e.g./etc/named.conf
.
apache
Then, focus on the remaining stuff related to apache, which will be located in homedir/public_html/
(though, it may be directly in /homedir/
in recent cpanel versions). The following WordPress installation, with a folder to a subdomain, can be used as an example:
homedir/public_html/
├── cgi-bin
├── configurations.json
├── css
├── font-awesome
├── fonts
├── img
├── index.php
├── js
├── LICENSE
├── license.txt
├── subdomain.yourdomainname.com
├── readme.html
├── sitemap.xml
├── strac-yourdomainname.com-phpindex
├── test.php
├── wp-activate.php
├── wp-admin
├── wp-blog-header.php
├── wp-comments-post.php
├── wp-config.php
├── wp-content
├── wp-cron.php
├── wp-includes
├── wp-links-opml.php
├── wp-load.php
├── wp-login.php
├── wp-mail.php
├── wp-settings.php
├── wp-signup.php
├── wp-trackback.php
└── xmlrpc.php
Copy the content to the DocumentRoot and update your apache config files with any VirtualHost options:
cp -r homedir/public_html/* /var/www/html/
vim /etc/httpd/httpd.conf
You might have to make the necessary changes to the PHP, apache, and/or mysql versions and configuration as well. Try to ensure the versions and options are as close to that of the cpainl server as possible.