Database & Asset Extraction: Capturing Production State from cPanel¶
Overview¶
A clean migration begins with an uncorrupted, complete export of production assets and relational state. Because the store is actively transacting, capturing the database and filesystem requires specific flags to avoid export timeouts, truncated tables, or capturing temporary cache bloat.
This guide outlines the standard operating procedure for extracting fresh state from Namecheap cPanel.
Step 1: Exporting MySQL Database via phpMyAdmin¶
- Log in to Namecheap cPanel and navigate to Databases > phpMyAdmin.
- Select the live database (e.g.,
peekfenm_wp583). - Click the Export tab in the top navigation bar.
- Select Export method: Custom - display all possible options.
- Configure the following export parameters:
- Tables: Select Check all.
- Output:
- Compression: None (or gzipped if connection speed is limited).
- Character set of the file: utf-8 (or
utf8mb4).
- Format-specific options:
- Ensure Structure and data is selected for all tables.
- Check Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT statement (ensures clean imports on fresh database initializations).
- Data creation options:
- Syntax to use when inserting data: both of the above (INSERT DELAYED / INSERT) or standard INSERT statements.
- Max length of created query:
50000.
- Click Export and save the file locally as
peekfenm_wp583.sql.
Verifying Table Prefix
Open the first 50 lines of the .sql file locally to verify the table prefix:
wpw4_ instead of wp_). Note this prefix down for the .env configuration file. Step 2: Extracting wp-content Filesystem Assets¶
Do not download the entire WordPress core filesystem (wp-admin, wp-includes, root PHP files). Core files are provided by the official Docker container runtime. Only the application content directory (wp-content/) is required.
- In Namecheap cPanel, open Files > File Manager.
- Navigate to
public_html/(or the root directory of the domain). - Right-click on the
wp-contentdirectory and select Compress. - Select Zip Archive and set the target archive path to
public_html/wp-content.zip. - Click Compress Files.
Sanitizing the Archive (Excluding Cache Bloat)¶
Before transferring, ensure that transient cache directories are excluded to save bandwidth and prevent stale cache conflicts:
- DO NOT include:
wp-content/cache/*(Static page cache generated by hosting plugins)wp-content/litespeed/*(LiteSpeed cache files, optimized scripts, or webp backups)wp-content/advanced-cache.php(Drop-in cache file that intercepts PHP boots)- MUST include:
wp-content/themes/*(Astra theme, child themes, and templates)wp-content/plugins/*(WooCommerce, Elementor, Stripe, Caddy, etc.)-
wp-content/uploads/*(All media files, product imagery, fonts, and Elementor CSS) -
Download
wp-content.zipdirectly to your local development machine.
Step 3: Staging Artifacts in the Docker Project Root¶
Once downloaded, transfer the database seed and assets into the target project directory on your development machine (or iximiuz playground):
# Project root directory structure
~/peeksleek-docker/
├── .env
├── docker-compose.yml
├── custom-php/
│ └── php-custom.ini
├── init-db/
│ └── peekfenm_wp583.sql # Database seed for MariaDB auto-init
└── wp-content.zip # Compressed assets ready for extraction
Staging Commands¶
# 1. Create the project directories
mkdir -p ~/peeksleek-docker/init-db
mkdir -p ~/peeksleek-docker/custom-php
# 2. Move or copy the database dump into the init-db mount
cp /path/to/peekfenm_wp583.sql ~/peeksleek-docker/init-db/
# 3. Verify the file permissions
chmod 644 ~/peeksleek-docker/init-db/*.sql
MariaDB 10.11 will automatically execute all .sql files placed inside /docker-entrypoint-initdb.d/ on initial volume creation.