Pantheon Community

Unique User Tables Per Environment


Is there any way to keep the users table unique to each environment?

For example, imagine there are 50 users in the Live environment but a bug has appeared that needs to be fixed in Dev and it may take a week. By the time the bug fixed, there are now 60 users in Live, but Dev still has the original 50 users. Now when the database is cloned with the new content/fixes from Dev it will overwrite Live, erasing the 10 new users.

How can I migrate everything but the users table?


Hello there!

Generally, you wouldn’t push up the database, only the code. “Code goes up; database comes down.” See this Pantheon help page:

I’m thinking that there might be something in the database itself that needs fixing. In that instance, code should be used to make the database changes. How I would do it is use a multidev site (say, called “user-fix”) based on live environment to create the code, then I’d create a new multidev also based on live and merge the “user-fix” branch there for testing. I’m overly cautious about database changes, especially if custom code is involved.

In case I’ve totally missed the boat on helping, tell us more about the issue that needs fixing and we’ll take another swing at it.


I agree, but content is stored in the same database as users right?

If I have multiple articles in Live that a tech writer needs to rewrite I’d like for them work in Dev and then push it to Live. Is there a way of doing this without having to copy/paste all the reworked content back to Live? Such as a database migration of only the content without overwriting the users table.

Ah, I see. There are many reasons (other than the user table) that pushing up the database isn’t optimal. Three possible solutions:

  • Workflow moderation: this allows editing of revisions without actually publishing the new content. It takes a bit to set up, but very powerful. We’ve used this module with great success:

  • Work with a copy: Replicate the content in question, make edits on the copy, then switch over to using that content in menus, links, ect. I tend to use this for things like making a new homepage or when content entity references, as many entities aren’t versioned. Module that helps:

  • Use “Deploy” module for staging and previewing: I don’t have experience with this one, so hoping that someone else chimes in here. Module:

Hope that helps a little more!

1 Like