# Errors with renku migrate

**URL:** <https://renku.discourse.group/t/errors-with-renku-migrate/765>\
**Category:** General\
**Created:** [13 March 2023 11:11 UTC](https://renku.discourse.group/t/errors-with-renku-migrate/765 "2023-03-13T11:11:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lusamino](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/lusamino/32/227_2.png) [@lusamino](https://renku.discourse.group/u/lusamino)\
**Post date:** [13 March 2023 11:11 UTC](https://renku.discourse.group/t/errors-with-renku-migrate/765/1 "2023-03-13T11:11:46Z")

</div>

Hi to all,

I have a repo that I created long time ago, so I am pretty sure that with quite an old `renku` version. I installed the last version of renku, leave the repo clean, and wanted to run a python script that works perfectly, as I have tested several times. However, when trying, `renku` prompts an error, urging me to do a migration, i.e. run `renku migrate`.

Well, I then try, and I get this

```auto
Fetching template from https://github.com/SwissDataScienceCenter/renku-project-template@0.3.5... 
Info: These parameters are not used by the template and were ignored:
        name

Initializing workflows/my-workflow.yaml ...
Ignoring identical file .dockerignore ...
Ignoring identical file .renkulfsignore ...
Ignoring identical file data/.gitkeep ...
Ignoring identical file environment.yml ...
Ignoring identical file notebooks/.gitkeep ...
Ignoring unchanged template file .gitignore ...
Ignoring unchanged template file requirements.txt ...
Keeping README.md ...
Overwriting .gitlab-ci.yml ...
Overwriting .renku/renku.ini ...
Overwriting Dockerfile ...
Updating dockerfile...
Updated dockerfile.
Applying migration m_0010__metadata_fixes...
Migrating old namespaces
Fixing activity ids
Error: Couldn't execute migration

Traceback (most recent call last):
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/renku/core/migration/migrate.py", line 173, in migrate_project
    module.migrate(migration_context)
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/renku/core/migration/m_0010__metadata_fixes.py", line 61, in migrate
    fix_dataset_date_modified()
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/inject/ __init__.py", line 342, in injection_wrapper
    return sync_func(*args, **kwargs)
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/renku/core/migration/m_0010__metadata_fixes.py", line 311, in fix_dataset_date_modified
    fix_creation_date(dataset)
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/renku/core/migration/m_0010__metadata_fixes.py", line 282, in fix_creation_date
    dataset.date_created = min([f.date_added for f in dataset.files])
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/renku/infrastructure/persistent.py", line 62, in __setattr__
    raise RuntimeError(f"Cannot modify immutable object {self}.{key}")
RuntimeError: Cannot modify immutable object <Dataset 67170d796d1f4444b77adc982c7a2ce5 democrasci_parliamentdb>.date_created

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/renku/ui/cli/exception_handler.py", line 92, in main
    return super().main(*args, **kwargs)
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/renku/ui/cli/migrate.py", line 135, in migrate
    result = command.build().execute(
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/renku/command/command_builder/command.py", line 266, in execute
    hook(self, context, result, *args, **kwargs)
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/renku/command/command_builder/command.py", line 202, in _post_hook
    raise result.error
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/renku/command/command_builder/command.py", line 252, in execute
    output = self._operation(*args, **kwargs) # type: ignore
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/inject/ __init__.py", line 342, in injection_wrapper
    return sync_func(*args, **kwargs)
  File "/Users/luissalamanca/anaconda3/envs/demockg/lib/python3.9/site-packages/renku/core/migration/migrate.py", line 175, in migrate_project
    raise MigrationError("Couldn't execute migration") from e
renku.core.errors.MigrationError: Couldn't execute migration

```

Obviously, no idea what is going on. Please, let me know how I could perform this, in order to start tracking the workflows.

Thank you so much!  
Best regards  
Luis

---

<div class="post-metadata">

**Author:** ![mohammad-sdsc](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/mohammad-sdsc/32/79_2.png) [@mohammad-sdsc](https://renku.discourse.group/u/mohammad-sdsc)\
**Post date:** [13 March 2023 12:46 UTC](https://renku.discourse.group/t/errors-with-renku-migrate/765/2 "2023-03-13T12:46:58Z")

</div>

Hi Luis,

Thank you very much for reporting this!

This is an issue on our side. We’ve made a fix. I’ll let you know once it’s merged.

Cheers!  
Mohammad

---

<div class="post-metadata">

**Author:** ![mohammad-sdsc](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/mohammad-sdsc/32/79_2.png) [@mohammad-sdsc](https://renku.discourse.group/u/mohammad-sdsc)\
**Post date:** [13 March 2023 14:52 UTC](https://renku.discourse.group/t/errors-with-renku-migrate/765/3 "2023-03-13T14:52:09Z")

</div>

Hello again @lusamino,

We’ve made a Renku CLI `2.3.2` release that should solve this issue. Please use it and let us know if the problem still exists.

If you are using Renkulab, launch a session, install the fixed version (`pip install --upgrade renku==2.3.2`), and migrate the project (`renku migrate`).

---

<div class="post-metadata">

**Author:** ![lusamino](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/lusamino/32/227_2.png) [@lusamino](https://renku.discourse.group/u/lusamino)\
**Post date:** [13 March 2023 19:25 UTC](https://renku.discourse.group/t/errors-with-renku-migrate/765/4 "2023-03-13T19:25:13Z")

</div>

Wow, thank you so much for the mega fast answer! All worked seamlessly 😍 I just had to run `git restore`, as they previous faulty `renku migrate` made some changes. But after that, all worked perfectly, and the repo is migrated!

Thank you so much!
