Roots Discourse

Committing Bedrock to GitLab Server for the First Time

I realized I haven’t committed my work to it’s git repo on my private gitlab server. I’m wondering what the process is for this as I have ~/Sites/myproject/trellis and ~/Sites/myproject/site.

Am I suppose to make ~/Sites/myproject a git repo? Or just /site? Or somewhere else? Or is there a script a run that uses things like vault.yml to push to the repo I specified?

I read through the docs about it all and am just a little confused.

Yes. The docs reference the recommend set up and the example at https://github.com/roots/roots-example-project.com.

Pushing or committing to your repo is done through Git as usual. Nothing really to do with Trellis. It just clones/pulls the repo if/when you deploy to a remote server.

Thank you for clarifying.

I don’t see anything in the instructions on Github or the Docs that indicate there is anything special I need to do to export / import that so I assume WP-CLI is the recommended route?

Trellis has a db_import variable built-in which just loads a SQL dump into your DB, but for anything beyond that, yeah we recommend WP CLI.

Thanks @swalkinshaw

Do you see any reason why there couldn’t be a db_export argument of some kind to automate this?

In my use case I can’t think of a time where I wouldn’t want to sync my database from development to staging if I’m pushing the rest of my code there. Do you (or anyone)?

It seems like if we had an argument that was like:

db_export_and_import = true

Also, do you guys poll your users at all? This is the type of thing I could imagine X% saying “No! I don’t want to sync my database everytime.” and then the other half saying they do.

There are some nice tools for transferring the data (database + uploads folder usually):

1 Like

I was just about to link what @strarsis did :slight_smile:

We primarily build features we need first. I think we did a poll once before or at least we wrote one and never sent it :frowning:

Either way, there’s just certain features we may not want to add even if a number of people would want it. DB syncing has always seemed like one of them. Not sure I have any great reasons for this.

Okay, I see how this conversation could go in a few directions.

I actually used Revisr Plugin for WordPress for backup automation. But I’ve never developed locally with it (the last time I did local development prior to Trellis was 5+ years ago).

But I didn’t think of something so robust for this particular task. Let me think on this and I’ll get back to you guys. Thank you for your time!

Deploying the app (WordPress site) is different to transferring/syncing the actual data of the app.
I always treat the production data as the source of truth (this was mentioned somewhere here in a thread already).

When developing apps (which also WordPress site is), often staging/development data is used that should resemble real world data, so it doesn’t have to be necessarily exactly the same as on production.

An alternative to overwriting is syncing the data between servers (e.g. production and staging/development), see this thread Sync user (modified) content.

1 Like