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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Accessing db via CLI?

    WordPress (Developer)
    2
    6
    158
    Loading More Posts
    • 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.
    • chetbaker
      chetbaker last edited by

      Hi there,

      I had an issue with my cloudron machine that forced me to use a backup and restore to a new location.

      The thing is now I need to access to the old WP instance where I just have access via SSH and not vía cloudron.

      I tried to use a mysqldumb using the files at credentials.txt with no luck. Is there a way of doing this?

      girish 2 Replies Last reply Reply Quote 0
      • girish
        girish Staff @chetbaker last edited by girish

        @chetbaker If I understand you correctly, you have access to your old cloudron instance and want to get the sql dump out of the WordPress instance inside it?

        I think the easiest way is to "trigger" a backup of the app via the Cloudron dashboard. What you do is:

        • Go to my.domain.com of your new Cloudron, and change the name/logo to something different (see below as to why).

        • Add an entry in your PC/laptop/Mac, /etc/hosts file like below. Replace 1.2.3.4 with the old server IP. Replace my.domain.com with your domain name.

            1.2.3.4 my.domain.com
        
        • Then, in the browser, my.domain.com . This will now give you access to your old cloudron. You might want to doubly make sure you are accessing the old server by checking the name/logo.

        • Trigger a backup. App -> Backups -> Create backup

        • You can now get the mysqldump file from wherever you store your backups. It will also be in /home/yellowtent/appsdata/<appid>/mysqldump on the server (replace appid with the id in Update section of the app

        1 Reply Last reply Reply Quote 1
        • girish
          girish Staff @chetbaker last edited by girish

          @chetbaker BTW, if it's better to get access to the old WordPress instead of dump files (maybe it's easier to import that way), then just fix the WP domain instead in the /etc/hosts file:

          1.2.3.4 wordpress.domain.com
          

          Then, if you go to https://wordpress.domain.com in the browser, you will hit the old wordpress. (you have to put the real domain you configured previously with and not some example domain).

          1 Reply Last reply Reply Quote 1
          • chetbaker
            chetbaker last edited by

            Thanks for the detailed explanation, @girish and I'm sorry if I explained it poorly, but this is the situation:

            In simple, I just lost edits of a single post we were editing in the old wordpress.

            I did what you said at the end, editing the /etc/hosts file to 1.2.3.4 wordpress.domain.com (obviously with the old server IP and my domain instead of domain.com) but I received this message on the browser:

            You are seeing this page because this domain points to Cloudron server IP but no app is installed on that domain.

            Is there something dummy I'm doing wrong?

            girish 1 Reply Last reply Reply Quote 0
            • girish
              girish Staff @chetbaker last edited by

              @chetbaker the message seems to indicate that there is no app for wordpress.domain.com on the old server. if you ssh into the old server and do docker ps | grep wordpress do you see wordpress there? you can then do docker inspect <containerid> | grep APP_ORIGIN to double check what domain it is serving.

              chetbaker 1 Reply Last reply Reply Quote 0
              • chetbaker
                chetbaker @girish last edited by

                @girish Yep, that worked! Thanks a lot.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB