monicahq / monica

Personal CRM. Remember everything about your friends, family and business relationships.
https://beta.monicahq.com
GNU Affero General Public License v3.0
21.72k stars 2.18k forks source link

Migrating from one system to another #5065

Open niladrishekhar opened 3 years ago

niladrishekhar commented 3 years ago

My Monica is self hosted and works amazing. Thank you for a personal assistant like Monica and my sincerest apologies for trying to hog all the attention with a bug report. I am hosting it on my own system(laptop) and now I have to change my system(a new laptop) - I dont want to loose out on the data part, I know how to back up the database and can take care of that on my own - I need some help with the root folder and files -

  1. which folders should I back up ?
  2. will just copying and pasting them in the new laptop work ?
  3. Is there an already established way that I am missing ?

Many thanks in advance.

virtadpt commented 3 years ago

The easiest thing to do is copy the entire Monica directory structure, cache and log directories and all, over to the new laptop. Then dump the database and restore onto the new laptop.

So, yes, copying and pasting to the new laptop will work. Just don't forget the database.

mgrhm commented 3 years ago

I didn't manage to copy and paste -- I had to do a fresh install today because it wouldn't work after I'd migrated it from one VPS to the other.

I ended up just reinstalling from scratch, copying over the .env file, and importing the database. This guide was really useful for importing the database.

When importing a database, make sure you use the same APP_KEY -- if you regenerate it like I did, you end up with a "MAC is invalid" error. I fixed it by putting in the original APP_KEY and rerunning php artisan setup:production -v.

Hope this is helpful.

mgrhm commented 3 years ago

Another update: after blowing up my install with some weirdness due to yarn (again!), I had to reinstall Monica to undo whatever damage had been done. After reimporting the database, my activities and gifts weren’t showing even though they were in the database. I had to re-run php artisan setup:production -v to get them to display.