A Dolibarr instance stores its identity in three separate places, and a migration fails whenever those three fall out of sync. The first is htdocs/conf/conf.php, which holds absolute filesystem paths and database credentials. The second is the llx_const table inside the database, which caches the installation's public URL and the physical location of generated documents. The third is the web server routing itself, controlled through DirectAdmin's domain setup and the .htaccess file in your document root. When you clone an account, swap a domain, or restore a backup under a new username, the old absolute paths such as /home/olduser/domains/old.com/public_html no longer exist, and Dolibarr either throws a fatal error on boot or silently serves broken document links and mismatched URLs.

This matters more for Dolibarr than for a typical blog because the application is path-aware in ways most PHP software is not. It writes PDF invoices, imports, backups, and ECM documents into a documents directory referenced by an absolute path, and it validates that the running URL matches the stored one. On managed shared hosting you cannot touch the filesystem outside your account, run shell commands, or alter the global PHP or database configuration. Every change below is done through the DirectAdmin interface, File Manager, phpMyAdmin, and the two per-account configuration files Dolibarr relies on.

Preparing a clean copy of files and database

Before changing anything, take a complete snapshot so you can roll back. In DirectAdmin open File Manager, navigate to the Dolibarr root (commonly /domains/old.com/public_html or a subfolder like /public_html/dolibarr), and compress the entire tree into a single archive. Pay particular attention to the documents folder, which frequently sits outside the public web root for security. Dolibarr's installer defaults to a path like /home/olduser/dolibarr_documents, so inspect htdocs/conf/conf.php and confirm the value of $dolibarr_main_data_root before you assume the documents live next to the code. If that directory is outside public_html, download it separately; a File Manager archive of only the web root will silently miss every invoice PDF and uploaded file.

For the database, open phpMyAdmin from DirectAdmin, select the Dolibarr database, choose the Export tab, and run a Custom export with the Add DROP TABLE option enabled and a reasonable max_allowed_packet behaviour (use the "gzipped" output if the dump is large, since shared accounts cap upload sizes). Keep this .sql.gz file alongside your file archive. If the migration is to a brand-new Hostiso account, create the destination database first: in DirectAdmin go to Account Manager → MySQL Management, add a new database and a new user, and record the exact database name, username, and password. On shared hosting these are automatically prefixed with your account name (for example newuser_dolib), which is one of the values you will correct in conf.php later.

Upload the file archive into the new document root using File Manager and extract it there. Then import the database: in phpMyAdmin on the destination, select the empty target database and use the Import tab to load your dump. Large Dolibarr databases with years of accounting history can exceed the web import limit, so if the import times out, split the dump by table or raise upload_max_filesize and max_execution_time for phpMyAdmin through a .user.ini as described below.

Rewriting conf.php for the new paths and credentials

With files and data in place, the single most important file is htdocs/conf/conf.php. Open it in File Manager's editor. Every absolute path and credential inside it points at the old environment, and Dolibarr will not boot until they describe the new one. The critical directives to correct read like this once updated for a new account and domain:

<?php
$dolibarr_main_url_root='https://new.com';
$dolibarr_main_document_root='/home/newuser/domains/new.com/public_html/htdocs';
$dolibarr_main_url_root_alt='/custom';
$dolibarr_main_document_root_alt='/home/newuser/domains/new.com/public_html/htdocs/custom';
$dolibarr_main_data_root='/home/newuser/dolibarr_documents';

$dolibarr_main_db_host='localhost';
$dolibarr_main_db_port='3306';
$dolibarr_main_db_name='newuser_dolib';
$dolibarr_main_db_user='newuser_dolib';
$dolibarr_main_db_pass='YOUR_NEW_PASSWORD';
$dolibarr_main_db_prefix='llx_';
$dolibarr_main_db_type='mysqli';

Find your exact home path by opening File Manager and reading the breadcrumb, or check the $_SERVER['DOCUMENT_ROOT'] value shown in a DirectAdmin phpinfo page; on Hostiso accounts it follows the /home/USERNAME/domains/DOMAIN/public_html pattern. The _alt entries only exist if you use custom modules, so leave them blank or remove them if the originals were empty. Keep $dolibarr_main_db_host as localhost because the database and site share the same account on shared hosting; do not point it at a remote hostname. If you change the data root, create that directory with File Manager outside public_html and move the uploaded documents contents into it so paths resolve.

After saving, visit the site. A blank screen or fatal error almost always traces back to a wrong path or password in this file; confirm by reading the local error_log that DirectAdmin writes into the domain folder. If you need to raise PHP limits for the import or for document generation, create a .user.ini in the Dolibarr root with memory_limit = 256M, upload_max_filesize = 64M, and max_execution_time = 300, and confirm the active PHP version under DirectAdmin → PHP Selector matches what the old site used. A version jump (for example 7.4 to 8.2) can surface deprecation fatals unrelated to the migration itself.

Correcting stored URLs in llx_const and routing with .htaccess

Even with a perfect conf.php, Dolibarr caches the public URL and file paths inside the llx_const table, so emails, PDF links, and absolute asset references keep pointing at the old domain. In phpMyAdmin run the SQL below against the destination database, substituting the real prefix if it is not llx_:

UPDATE llx_const
SET value = 'https://new.com'
WHERE name = 'MAIN_INFO_SOCIETE_WEB';

UPDATE llx_const
SET value = REPLACE(value, 'old.com', 'new.com')
WHERE value LIKE '%old.com%';

UPDATE llx_const
SET value = REPLACE(value, '/home/olduser/', '/home/newuser/')
WHERE value LIKE '%/home/olduser/%';

The second and third statements catch stored paths for things like custom logos, backup directories, and module settings that embedded the old domain or home path. After running them, log into the Dolibarr back office and open Home → Setup → Company/Organization to verify the web address and logo resolve, then check Setup → System tools → Dolibarr which reports the detected document and data roots so you can confirm they match the new filesystem.

Finally, align routing. If the old install used friendly URLs or forced HTTPS, replace the stale rules in the document-root .htaccess. A clean baseline that forces HTTPS on the new domain and leaves Dolibarr's own routing intact looks like this:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://new.com/$1 [R=301,L]

<FilesMatch "\.(php|inc)$">
    Require all granted
</FilesMatch>

Remove any old RewriteBase or redirect lines that referenced the previous domain or subdirectory, since a leftover rule pointing at old.com will loop or 404. If Dolibarr now lives in a subfolder rather than the root, set $dolibarr_main_url_root to include that subfolder and adjust the DirectAdmin domain so the document root maps correctly. Clear the Dolibarr cache by deleting the contents of the documents/admin/temp folder through File Manager, then log out and back in. Teams migrating payment or callback-driven CRMs face the same URL-sync discipline; our note on fixing SSL redirects and mixed content on shared hosting covers the HTTPS edge cases worth re-testing once the new domain is live.