Migrating from FarmOS v1 to FarmOS v2

I am using v1 since two years now, and Im very happy to manage all my farm assets and activities. now as you announced the new version, and I watched your videos… I installed the new v2 on a local server in my farm after I got internet on the farm… I learned how to do this installation by following steps from the internet… I am not an IT… but I grow olives … with a modern touch… so now I want to go to V2 I need to move the data from the old one to the new one. when I read the tutorial… it looks very complicated to me… or I might need long time to know how to do it… this discussion area is open for everyone to support people like me on how to migrate the data please help me in defending the steps …

2 Likes

Reading the docs (Migrating from farmOS 1.x to 2.x | farmOS) there is a series of steps you must follow:
1.- Install v2 alongside with v1
2.- Install v2 versions of modules that you already have installed in v1
3.- Config the v1 database in the v2 settings.php
4.- Copy uploaded files from v1 to v2
5.- In the v2, activate the Farm1.x migration module
6.- Run the drush commands to move the data

What step are you stuck on? Are you running the v1 on docker? Are you going to run the v2 on docker? And the databases, also docker?
If you are running on docker, step 6 must be done inside the container, and you must be sure that the v2 can access the v1 database.

I started with v2, so I didn’t migrate myself, but if you provide more info I’m sure that other people that actually did it could help you

1 Like

this part need help… how to do the
Copy uploaded files from v1 to v2
How to do that… and what files I will move from which folders in each version.

1 Like

Glad to hear you’re making the leap to v2 @anas! Happy to help! :smiley:

Before I say anything else: MAKE A BACKUP! Create a zip/tarball of your entire v1 directory, and a snapshot of your v1 database. The v2 migration will not make any changes to these, but regardless it’s good to have just in case anything goes wrong.

How to do that… and what files I will move from which folders in each version.

Here is the relevant section of the documentation: Migrating from farmOS v1 | farmOS

farmOS (Drupal) has a configuration setting that defines where all uploaded files (eg: photos etc) are stored in the server’s filesystem.

In your farmOS v1 instance, open this page in your browser: /admin/config/media/file-system - This will show you where your public and private file directories are located, relative to your installation. This should help you in locating the files in your v1 instance.

In your v2 instance, you need to start by configuring your public and private file directories. The public one may have been created automatically for you during installation, but you will need to manually set up your private directory and add a line to your settings.php file to point to it. This directory needs to be writable by www-data (the Apache user) so that files can be written to it.

This is described here: Installing farmOS | farmOS

Once you locate your v2 public and private file directories, you need to create a new directory inside each called migrate. Then copy ALL files from the v1 public directory into the v2 files/migrate directory, and all files from v2 private directory into the v2 private/files/migrate directory. The official docs describes how to do this with the cp command, but you will need to replace the specific directory names for your environment.

cp -rp [your-v1-codebase]/sites/default/files [your-v2-codebase]/web/sites/default/files/migrate

cp -rp [your-v1-codebase]/sites/default/private/files [your-v2-codebase]/web/sites/default/private/files/migrate

(Note that this also assumes your files directories are in sites/default/files and sites/default/private/files, which is standard convention, but it’s possible to set them up differently, so adjust that bit accordingly to match your environment.)

Dear Mstenta

I moved the files as explained. now I was looking for the migration module in the v2… but couldn’t find it to activate it… do I need to download it… and then activate it… can you help in this

1 Like

Hi @anas Ah yea the Migration docs are a bit vague on how to enable the module. Best thing to do is use Drush command: drush en farm_migrate

You’ll need to figure out how to run Drush commands in order to perform the migration anyway, so that’s a good place to start. Let me know if you have any trouble.