What information should be modified in dev after a sql dump


(Ryan Odening) #1

So I just did a sql dump of our prod db into our dev db so we have some good data to work with.

I wanna run a script that changes anything that could mess stuff up for peeps.

All I can think of right now are user emails (so they don’t get notifications when I play around in dev).
What should be changed for this? I see there is a user_emails table, an email column in the users table, and some other tables and columns having to do with emails. Not sure if changing email in user_emails and email in users will be enough.

Also would love to hear if there’s things I should change in addition to email.

Thanks!


(Jay Pfaffman) #2

You might just disable emails or just don’t configure your dev box to be able to send mail.


(Ryan Odening) #3

thanks! how do you disable emails?


(Jay Pfaffman) #4

https://yoursite.com/admin/site_settings/category/all_results?filter=disable%20emai


(Ryan Odening) #5

I see it! thanks!
One more thing for anyone who can help: We just completely overwrote our dev database (no other files), and now our dev domain does not work.
Where in the db can i update the correct info back to make our domain work again?


(Jay Pfaffman) #6

On a development site, you can do

    RAILS_ENV=development bundle exec rake db:drop db:create db:migrate

(Ryan Odening) #7

figured it out!

this line works:
update topic_links set domain = regexp_replace(domain, [old_domain], [new_domain])