# Migrate From lakeFS Community to lakeFS Enterprise

To migrate from lakeFS Community to lakeFS Enterprise, follow the steps below:

1. [Contact us](<https://lakefs.io/contact-sales/>) to gain access to lakeFS Enterprise.
2. Update the lakeFS Docker image to the enterprise version. Replace `treeverse/lakefs` with `treeverse/lakefs-enterprise` in your configuration. The enterprise image can be pulled using your lakeFS Enterprise token.
3. Sanity Test (Optional): Install a new test lakeFS Enterprise before moving your current production setup. Test the setup \> login \> Create repository etc. Once everything seems to work, delete and cleanup the test setup and we will move to the migration process.
4. Make sure to configure the lakeFS enterprise properly, see [Enterprise installation guide](<https://docs.lakefs.io/admin/install/enterprise/index.md>)

   1. Update your existing lakeFS configuration for enterprise (i.e `values.yaml` file for your deployment if using helm)
5. DB Migration: We are going to use the same database for lakeFS Enterprise, so we need to migrate the database schema.
6. Make sure to SSH / exec into the lakeFS server (old pre-upgrade version); the point is to use the same lakeFS configuration file when running a migration.

   1. If upgrading `lakefs` version do this or skip to the next step: Install the new lakeFS binary, if not use the existing one (the one you are running).
   2. Run the command: `LAKEFS_AUTH_UI_CONFIG_RBAC=internal lakefs migrate up` (use the **new binary** if upgrading lakeFS version).
   3. You should expect to see a log message saying Migration completed successfully.
   4. During this short DB migration process, please make sure not to make any policy / RBAC related changes.
7. Once the migration completed - Upgrade your helm release with the modified `values.yaml` and the new version and run `helm ugprade`.
8. Login to the new lakeFS pod: Execute the following command, make sure you have proper credentials, or discard to get new ones:

   ```shell
   lakefs setup --user-name <admin> --access-key-id <key> --secret-access-key <secret> --no-check
   ```

> [!WARNING]
>
> Please note that the newly set-up lakeFS instance remains inaccessible to users until full setup completion, due to the absence of established credentials within the system.
