Domain Migration
This guide covers everything you need to know when migrating your Botble CMS installation to a new domain, subdomain, or server.
Overview
Domain migration involves moving your website from one domain (e.g., example.com) to another (e.g., new-example.com or subdomain.example.com). This process requires careful handling of:
- License management
- Database configuration
- Media files and assets
- URL references in content
- SSL certificates
Migration Methods
There are two approaches to domain migration:
| Method | Best For | Complexity |
|---|---|---|
| Full Migration | Preserving all content, settings, and configurations | Medium |
| Fresh Install + Content Migration | Starting clean with selective content transfer | Simple |
Pre-Migration Checklist
Before starting the migration, complete these steps:
1. License Management
Important
Your license is tied to your domain. You must handle it properly before migration.
Option A: Deactivate Before Migration (Recommended)
- Go to Admin Panel → Settings → General
- Click Deactivate License
- Proceed with migration
- Activate license on the new domain after migration
Option B: Backup License File
- Download
/storage/.licensefile from your current installation - After migration, upload this file to the new server
- If activation issues occur, reset your license at https://license.botble.com
2. Create Full Backup
Create a complete backup before any migration:
php artisan cms:backup:create "pre-migration-backup" --description="Full backup before domain migration"Or through the admin panel:
- Go to Admin Panel → System Administration → Backups
- Click Create
- Select both database and uploaded files
- Download the backup to your local machine
3. Document Current Configuration
Note down your current settings:
- Active theme name
- Installed and activated plugins
- Custom configurations in
.env - Third-party integrations (payment gateways, email services, etc.)
- Custom code modifications (if any)
Method 1: Full Migration (Recommended)
This method preserves all your content, settings, and configurations.
Step 1: Prepare the New Server
Set up your new server/hosting with the required environment:
- PHP 8.2+
- MySQL 8.0+ or MariaDB 10.3+
- Required PHP extensions
Point your new domain to the server
Step 2: Transfer Files
Transfer all files to the new server:
# Using rsync (recommended)
rsync -avz --progress /path/to/old-site/ user@new-server:/path/to/new-site/
# Or using SCP
scp -r /path/to/old-site/* user@new-server:/path/to/new-site/Step 3: Export and Import Database
On the old server:
mysqldump -u username -p database_name > database_backup.sqlOn the new server:
mysql -u username -p new_database_name < database_backup.sqlStep 4: Update Configuration
Edit the .env file on the new server:
APP_URL=https://your-new-domain.com
# Database credentials (update if changed)
DB_HOST=localhost
DB_DATABASE=your_new_database
DB_USERNAME=your_new_username
DB_PASSWORD=your_new_passwordStep 5: Update URLs in Database
Run the following command to update old domain references in the database:
php artisan cms:domain:change old-domain.com new-domain.comIf this command is not available, you can manually update URLs using SQL:
-- Update site settings
UPDATE settings SET value = REPLACE(value, 'old-domain.com', 'new-domain.com')
WHERE value LIKE '%old-domain.com%';
-- Update media URLs (if using full URLs)
UPDATE media_files SET url = REPLACE(url, 'old-domain.com', 'new-domain.com')
WHERE url LIKE '%old-domain.com%';
-- Update page content
UPDATE pages SET content = REPLACE(content, 'old-domain.com', 'new-domain.com')
WHERE content LIKE '%old-domain.com%';
-- Update post content
UPDATE posts SET content = REPLACE(content, 'old-domain.com', 'new-domain.com')
WHERE content LIKE '%old-domain.com%';Step 6: Clear Cache and Optimize
php artisan cache:clear
php artisan config:clear
php artisan view:clear
php artisan route:clear
php artisan optimizeStep 7: Set Permissions
chmod -R 755 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cacheStep 8: Activate License
- Go to Admin Panel → Settings → General
- Enter your purchase code
- Click Activate
If activation fails:
- Visit https://license.botble.com
- Reset your license
- Try activating again
Method 2: Fresh Install + Content Migration
This method is simpler and recommended when:
- You want to start with a clean installation
- Your current site has issues or bloat
- You're upgrading to a significantly newer version
Step 1: Fresh Installation
- Install Botble CMS on your new domain following the installation guide
- Activate your license on the new domain
- Install the same plugins you had on the old site
Step 2: Export Content from Old Site
Database Export:
# Export specific tables
mysqldump -u username -p database_name \
posts post_translations post_categories post_tags \
pages page_translations \
categories category_translations \
tags tag_translations \
menus menu_nodes menu_locations \
widgets widget_areas \
> content_export.sqlMedia Files:
# Archive the uploads folder
tar -czvf media_backup.tar.gz storage/app/public/Step 3: Import to New Site
Import Content:
mysql -u username -p new_database < content_export.sqlImport Media:
tar -xzvf media_backup.tar.gz -C /path/to/new-site/storage/app/
php artisan storage:linkStep 4: Reconfigure Settings
Manually reconfigure:
- Theme settings
- Widget positions
- Menu structures
- Site settings
- Plugin configurations
Post-Migration Tasks
1. Verify Site Functionality
- [ ] Homepage loads correctly
- [ ] All pages accessible
- [ ] Admin panel works
- [ ] Media files display properly
- [ ] Forms submit successfully
- [ ] Email notifications work
2. Update External Services
Update your domain in:
- Google Analytics
- Google Search Console
- Social media integrations
- Payment gateways
- Email service providers
- CDN configurations
3. Set Up Redirects
Configure 301 redirects from old domain to new domain:
Apache (.htaccess on old server):
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?old-domain\.com$ [NC]
RewriteRule ^(.*)$ https://new-domain.com/$1 [R=301,L]Nginx (on old server):
server {
server_name old-domain.com www.old-domain.com;
return 301 https://new-domain.com$request_uri;
}4. Update DNS Records
If keeping the same domain but changing servers:
- Lower TTL values 24-48 hours before migration
- Update A records to point to new server IP
- Update any other relevant records (MX, CNAME, etc.)
5. SSL Configuration
Set up SSL on the new domain:
# Using Let's Encrypt with Certbot
certbot --nginx -d new-domain.com -d www.new-domain.comUpdate .env:
APP_URL=https://new-domain.com
ENABLE_HTTPS_SUPPORT=trueSubdomain Migration
When migrating to a subdomain (e.g., site.example.com to app.example.com):
- Follow the same steps as domain migration
- Ensure subdomain DNS is properly configured
- Update
APP_URLin.envto include the full subdomain
Example:
# Old
APP_URL=https://site.example.com
# New
APP_URL=https://app.example.comTroubleshooting
License Activation Failed
- Ensure old domain license is deactivated
- Reset license at https://license.botble.com
- Clear browser cache and try again
- Contact support at [email protected] if issues persist
Images Not Displaying
- Run
php artisan storage:link - Check file permissions on
storage/app/public - Verify symlink exists:
ls -la public/storage - If using CDN, update CDN origin settings
500 Internal Server Error
- Check Laravel logs:
storage/logs/laravel.log - Verify
.envconfiguration - Run
php artisan config:clear - Ensure all required PHP extensions are installed
Mixed Content Warnings
If seeing HTTPS/HTTP mixed content warnings:
- Ensure
APP_URLuseshttps:// - Add
ENABLE_HTTPS_SUPPORT=trueto.env - Run database URL replacement queries
- Clear all caches
Database Connection Errors
- Verify database credentials in
.env - Ensure database server is running
- Check if database user has proper permissions
- Test connection:
php artisan db:show
Rollback Plan
If migration fails, you can restore from backup:
- Restore files from your backup archive
- Restore database:bash
mysql -u username -p database_name < backup.sql - Update
.envwith old domain settings - Activate license on old domain
Best Practices
- Test First: Set up a staging environment to test the migration process
- Schedule Wisely: Migrate during low-traffic periods
- Communicate: Notify users of planned downtime
- Keep Backups: Maintain backups of both old and new installations for at least 30 days
- Monitor: Watch error logs and analytics after migration
Quick Reference: Migration from site-a.com to subdomain.site-b.com
Example scenario: Moving from jombitcoin.com to unwind.jomplan.com
# 1. Deactivate license on jombitcoin.com (Admin → Settings → General)
# 2. Create backup
php artisan cms:backup:create "pre-migration"
# 3. Transfer files to new server
# 4. Update .env on new server
APP_URL=https://unwind.jomplan.com
# 5. Import database and update URLs
mysql -u user -p database < backup.sql
# Run URL replacement if needed
UPDATE settings SET value = REPLACE(value, 'jombitcoin.com', 'unwind.jomplan.com');
# 6. Clear caches
php artisan optimize:clear
# 7. Set permissions
chmod -R 755 storage bootstrap/cache
# 8. Activate license on unwind.jomplan.comTIP
For assistance with domain migration, contact our support team at [email protected] or create a ticket at https://botble.ticksy.com
