Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. WordPress (Developer)
  3. wp db import : file missing or not readable

wp db import : file missing or not readable

Scheduled Pinned Locked Moved WordPress (Developer)
9 Posts 4 Posters 15 Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • sebastienserreS Offline
    sebastienserreS Offline
    sebastienserre
    wrote last edited by
    #1

    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 ?

    He/Him - Native language: French

    1 Reply Last reply
    0
    • jamesJ Online
      jamesJ Online
      james
      Staff
      wrote last edited by
      #2

      Hello @sebastienserre
      Have you tried using the full path to the file?

      wp db import /app/data/public/backup.sql
      
      1 Reply Last reply
      0
      • P Offline
        P Offline
        p44
        translator
        wrote last edited by p44
        #3

        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 DB
        

        cfda74f223139c8 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.

        1 Reply Last reply
        0
        • jamesJ Online
          jamesJ Online
          james
          Staff
          wrote last edited by
          #4

          Hello @p44
          This is one way.
          It is also documented https://docs.cloudron.io/guides/import-mysql

          But I know that @sebastienserre knows about this documentation from his latest @dolibarr migration.
          So I guess his question is specific to the wp-cli.

          P 1 Reply Last reply
          2
          • jamesJ james

            Hello @p44
            This is one way.
            It is also documented https://docs.cloudron.io/guides/import-mysql

            But I know that @sebastienserre knows about this documentation from his latest @dolibarr migration.
            So I guess his question is specific to the wp-cli.

            P Offline
            P Offline
            p44
            translator
            wrote last edited by p44
            #5

            @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

            1 Reply Last reply
            1
            • sebastienserreS Offline
              sebastienserreS Offline
              sebastienserre
              wrote last edited by sebastienserre
              #6

              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

              He/Him - Native language: French

              1 Reply Last reply
              1
              • sebastienserreS Offline
                sebastienserreS Offline
                sebastienserre
                wrote last edited by
                #7

                @p44 tip works but it's really easier to launch a wp db import backup.sql command.

                He/Him - Native language: French

                1 Reply Last reply
                2
                • P Offline
                  P Offline
                  p44
                  translator
                  wrote last edited by
                  #8

                  @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?

                  jdaviescoatesJ 1 Reply Last reply
                  1
                  • P p44

                    @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?

                    jdaviescoatesJ Online
                    jdaviescoatesJ Online
                    jdaviescoates
                    wrote last edited by
                    #9

                    @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 ?

                    I use Cloudron with Gandi & Hetzner

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Bookmarks
                    • Search