wp db import : file missing or not readable
-
Hello,
On my others hosting system, I sued to use WP-CLI to manage my WordPress websites.
To import DB I'm using https://developer.wordpress.org/cli/commands/db/import/On my Cloudron WordPress developer, I can't use this command.
root@b8b274fd-2cfa-49b9-a088-fb2f905ba032:/app/data/public# wp db import backup.sql Error: Import file missing or not readable: backup.sql root@b8b274fd-2cfa-49b9-a088-fb2f905ba032:/app/data/public# ls -la total 85896 drwxr-xr-x 6 www-data www-data 4096 Jan 15 06:40 . drwxr-xr-x 4 www-data www-data 4096 Jan 15 06:27 .. -rw-r--r-- 1 www-data www-data 87625537 Jan 15 06:39 backup.sql -rw-r--r-- 1 www-data www-data 405 Jan 15 06:26 index.php -rw-r--r-- 1 www-data www-data 19903 Jan 15 06:26 license.txt -rw-r--r-- 1 www-data www-data 7425 Jan 15 06:26 readme.html -rw-r--r-- 1 www-data www-data 7349 Jan 15 06:26 wp-activate.php drwxr-xr-x 9 www-data www-data 4096 Jan 15 06:26 wp-admin -rw-r--r-- 1 www-data www-data 351 Jan 15 06:26 wp-blog-header.php -rw-r--r-- 1 www-data www-data 2323 Jan 15 06:26 wp-comments-post.php -rw-r--r-- 1 www-data www-data 3339 Jan 15 06:26 wp-config-sample.php -rw-rw-r-- 1 www-data www-data 3690 Jan 15 06:27 wp-config.php drwxr-xr-x 17 www-data www-data 4096 Jan 15 06:51 wp-content drwxr-xr-x 6 www-data www-data 4096 Jan 15 06:27 wp-content-old -rw-r--r-- 1 www-data www-data 5617 Jan 15 06:26 wp-cron.php drwxr-xr-x 31 www-data www-data 16384 Jan 15 06:26 wp-includes -rw-r--r-- 1 www-data www-data 2493 Jan 15 06:26 wp-links-opml.php -rw-r--r-- 1 www-data www-data 3937 Jan 15 06:26 wp-load.php -rw-r--r-- 1 www-data www-data 51437 Jan 15 06:26 wp-login.php -rw-r--r-- 1 www-data www-data 8727 Jan 15 06:26 wp-mail.php -rw-r--r-- 1 www-data www-data 31055 Jan 15 06:26 wp-settings.php -rw-r--r-- 1 www-data www-data 34516 Jan 15 06:26 wp-signup.php -rw-r--r-- 1 www-data www-data 5214 Jan 15 06:26 wp-trackback.php -rw-r--r-- 1 www-data www-data 3205 Jan 15 06:26 xmlrpc.php root@b8b274fd-2cfa-49b9-a088-fb2f905ba032:/app/data/public#Any idea why ?
-
I donโt know your use case, but please try to follow these steps, from Cloudron instance command line.
Note that the old DB will be totally deleted.
Before, upload mysqldump.sql to TMP folder
Then, open MySQL command line and type:
STATUS; //to know database name DROP DATABASE cfda74f223139c8; //delete old DB CREATE DATABASE cfda74f223139c8; //create a new DB USE cfda74f223139c8; //use new created DB SOURCE mysqldump.sql; //import DBcfda74f223139c8 is only for demo purpose, instead, youโve to put your DB Name that comes from STATUS command.
Check if DB is imported:
show tables;Let us know if everything works good.
-
Hello @p44
This is one way.
It is also documented https://docs.cloudron.io/guides/import-mysqlBut I know that @sebastienserre knows about this documentation from his latest @dolibarr migration.
So I guess his question is specific to the wp-cli. -
Hello @p44
This is one way.
It is also documented https://docs.cloudron.io/guides/import-mysqlBut I know that @sebastienserre knows about this documentation from his latest @dolibarr migration.
So I guess his question is specific to the wp-cli.@james Method I suggested is "half way" between wp-cli and Cloudron.

ยซAll roads lead to Romeยป
Letโs see if works also for @sebastienserre scenario
-
Yes, my question was, why this specific import method from WPCLi (which is easier than a SQL query) doesn't work.
I do not know if I'm doing something wrong or if it's a limitation of the WordPress developer Cloudron app.but thank you for your tip @p44
-
@p44 tip works but it's really easier to launch a
wp db import backup.sqlcommand. -
@sebastienserre Thanks for your feedback: Iโm glad that method works.
About your original question, did you try to upload file in TMP folder and then, from command line, point to that file?
-
@sebastienserre Thanks for your feedback: Iโm glad that method works.
About your original question, did you try to upload file in TMP folder and then, from command line, point to that file?
@p44 said in wp db import : file missing or not readable:
did you try to upload file in TMP folder and then, from command line, point to that file?
or just the full path as suggested by @james ?
-
oh! I'm sorry, i missed @james answer.
wp dbcommand works with the full path -
J james marked this topic as a question
-
J james has marked this topic as solved
-
