Connect to remote database with Sequel Pro on Digital Ocean

I think that I can see the light at the end of tunnel.
I created a staging environment on Digital Ocean, I did the Provision and I did the deploy successful.

I can see the website at staging.namexxx.co.uk

Next step it is to migrate the database from my local to the staging, but I am stuck in this situation from yesterday.
I think that I read pretty much all the threads, but with no luck.

I always did the migration of the database manually, I download the db, search and replace paths, and then upload the db to the new website.

Can I follow the same workflow also with trellis and bedrock?

I can connect to my local db with Sequel Pro, but I can’t connect to the remote database.

this is my details in sequel pro
Sequel

and this show my errors

could please someone help me understand where I’m wrong?

thanks

The database import section of our Existing Trellis Project docs might be instructive here.

Basically the easiest way to do this is with wp-cli:

Connect to your Vagrant machine with SSH:

$ vagrant ssh

Change directories to your web root:

$ cd /srv/www/example.com/current

Export the development database:

$ wp db export

Transfer the exported file to the web root on your staging site (I usually just drag-and-drop it via (s)FTP here).

Connect to your staging environment with SSH:

$ ssh web@staging.example.com

Change directories to your web root:

$ cd /srv/www/example.com/current

Reset the current staging database to clear it for import:

$ wp db reset

Import the uploaded database dump:

$ wp db import [exported_development_database_file.sql]

Search/replace the development URL:

$ wp search-replace example.test staging.example.com
3 Likes

thanks @MWDelaney

I run “wp db export” and I get this error

vagrant@xxxxx:~$ wp db export
Error: This does not seem to be a WordPress install.
Pass --path=`path/to/wordpress` or run `wp core download`. 

:sob:

What can i try to do?

btw I can export the development database with sequel pro without problems and I can do the Search/replace on my local.

Can i jump some of these steps (wp db export and wp search-replace example.test staging.example.com)?

thanks

I run “wp db export” and I get this error

Where are you running it? What directory are you in and on what server?

I run from my project’s trellis directory, on my local machine (mac).

is it correct?

No, please look at the reply I made above. You appear to have skipped the first three steps and jumped ahead.

sorry my error, i did that step, but I forgot to add cd to the second step.

this is what I run

I noticed that so I tried to re-do these steps, from my trellis folder, and I run

So I thought to use transmit and visualise the tree directory

52

what I can try to do?

Can I add my exported_development_database_file.sql inside the staging.namesite.co.uk and try the other steps?

thanks again

You need to be in your site’s current directory to perform the export.

You’re receiving an error when you try to change directories that there’s No such file or directory, so perhaps you’ve misspelled something.

Try typing

cd /srv/www/staging.██████████.co.uk/current

If that doesn’t exist, check your typing for typos.

Great, I found what was the problem.
my local folder is called namexxx.co.uk, so i run cd /srv/www/namexxx.co.uk/current and works.

I can see the sql inside the “site” folder

regards the next step
Transfer the exported file to the web root on your staging site (I usually just drag-and-drop it via (s)FTP here).

what do you mean for “web root”?
this directory /srv/www/staging.namexxx.co.uk/current ?

Yes, that’s correct.

almost there, I run the last step but i received this error.

Error: Sage â€ș ErrorAutoloader not found.. You must run composer install from the Sage directory.

My deploy already included the vendor directory and I can see the vendor directory with the sftp

Have I to run again composer install from the Sage directory on my staging environment or there is another step that I am missing?

Please refer to the Deploys page of the Trellis documentation:

And review the deploy-hooks/build_before.yml file in your Trellis project.

I tried to run ‘composer install’ from the theme directory, without errors in the console.

but I can see a blank page, i am checking the logs right now.

as you suggested, i will read again the deploy page documentation.

last question, @MWDelaney do you think that it is a deploy problem, server issue, theme or 
 ?
what are your feelings?
if you can direct me in the right direction, it would be really helpful.

many thanks

This has derailed, original question was about connecting to a remote database, not deploying

At this point we’re troubleshooting your specific website rather than the Roots tools. Without knowing more about your setup and goals I can’t effectively consult on what the issue is.

We do offer troubleshooting calls, which this seems like a good case for. Details are are at this URL:

2 Likes

If you’re continuing to have deployment issues and you’ve reviewed the deploy-hooks material feel free to open another thread with as much detail as possible regarding your issue and what you want the outcome to be.