getredash / redash-toolbelt

API client and utilities to manage a Redash instance
BSD 2-Clause "Simplified" License
140 stars 74 forks source link

redash-migrate doesn't migrate dashboards #120

Open annpag opened 2 years ago

annpag commented 2 years ago

Hi, I'm trying to migrate all settings of an instance of Redash, but when i run the command redash-migrate dashboards, i get this error:

500 Server Error: INTERNAL SERVER ERROR for url: http://localhost:5000/api/dashboards/edifici Traceback (most recent call last): File "C:\.......\examples\migrate.py", line 1233, in wrapped func(*args, **kwargs) File "C:\.......\examples\migrate.py", line 752, in import_dashboards d = orig_client.dashboard(dashboard["slug"]) File "C:\.......\redash_toolbelt\client.py", line 85, in dashboard return self._get("api/dashboards/{}".format(slug)).json() File "C:\.......\redash_toolbelt\client.py", line 203, in _get return self._request("GET", path, **kwargs) File "C:\.......\redash_toolbelt\client.py", line 214, in _request response.raise_for_status() File "C:\.......\requests\models.py", line 960, in raise_for_status raise HTTPError(http_error_msg, response=self)

I run commands using the order that commands are shown in the output of the --help option and i'm using redash-migrate version 0.1.9 with 2 instance of Redash version 10.1.0. Can you help me? Thanks

jagin commented 2 years ago

There is a bug here: https://github.com/getredash/redash-toolbelt/blob/f6d2c40881fcacb411665c75f3afbe570533539d/redash_toolbelt/examples/migrate.py#L752

line d = orig_client.dashboard(dashboard["slug"]) should be d = orig_client.dashboard(dashboard["id"])

susodapop commented 2 years ago

Yes, this is a side-effect of the migration script being written primarily to move legacy users of Hosted Redash onto V10. The script will not work between V10 -> V10 until @jagin's change is made.