# Raco pkg migrate

**URL:** <https://racket.discourse.group/t/raco-pkg-migrate/963>\
**Category:** General\
**Tags:** tips\
**Created:** [May 3, 2022, 7:00pm UTC](https://racket.discourse.group/t/raco-pkg-migrate/963 "2022-05-03T19:00:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![spdegabrielle](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/spdegabrielle/32/95_2.png) [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)\
**Post date:** [May 3, 2022, 7:00pm UTC](https://racket.discourse.group/t/raco-pkg-migrate/963/1 "2022-05-03T19:00:48Z")

</div>

> `raco pkg migrate` reinstalls all the packages you had in a previous installation  
> Specifically, I just ran `raco pkg migrate 8.4` after installing 8.5

(Copied from @benknoble on discord)

---

<div class="post-metadata">

**Author:** ![sschwarzer](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/sschwarzer/32/1940_2.png) [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Post date:** [May 3, 2022, 9:48pm UTC](https://racket.discourse.group/t/raco-pkg-migrate/963/2 "2022-05-03T21:48:35Z")

</div>

> [@spdegabrielle](#):
>
> I just ran `raco pkg migrate 8.4` after installing 8.5

I just want to remark that this only works for user package scope, as stated in the documentation:

> [raco pkg migrate](https://docs.racket-lang.org/pkg/cmdline.html#%28part._raco-pkg-migrate%29) ‹option› ... ‹from-version› — Installs packages that were previously installed in user [package scope](https://docs.racket-lang.org/pkg/Package_Concepts.html#%28tech._package._scope%29) for ‹from-version›, where ‹from-version› is an installation name/version.

This makes sense because otherwise `raco pkg migrate` wouldn't be able to find the packages if they're in a "non-standard" location.

When I run `raco pkg migrate 8.4`, I get

```scheme
$ raco pkg migrate 8.4
No packages from "8.4" to install

```

What about a different message, something like

```scheme
Didn't find any packages to migrate from Racket 8.4. `raco pkg migrate` can only migrate packages that were installed in user scope, see https://docs.racket-lang.org/pkg/Package_Concepts.html#%28tech._package._scope%29 .

```

(A shorter URL would be nicer, of course.) I'm sure that message isn't perfect either. Maybe someone else has a better idea?

---

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [May 3, 2022, 10:45pm UTC](https://racket.discourse.group/t/raco-pkg-migrate/963/3 "2022-05-03T22:45:47Z")

</div>

I like the improvement! Are there lots of packages that aren't user scope (either by requirement or by choice)? For some reason I expect that to be rare.

---

<div class="post-metadata">

**Author:** ![sschwarzer](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/sschwarzer/32/1940_2.png) [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Post date:** [May 3, 2022, 11:42pm UTC](https://racket.discourse.group/t/raco-pkg-migrate/963/4 "2022-05-03T23:42:54Z")

</div>

As far as I know the scope is a property of your Racket installation. You can set it with `raco pkg config`, described in the [package management FAQ](https://docs.racket-lang.org/pkg/FAQ.html).

Edit: User scope is the default, so the `raco pkg migrate` command should work most of the time, i.e. when you haven't changed the scope. (I don't know if there are other limitations for `raco pkg migrate` apart from the scope.)

At some point I had set the scope to `installation` because there was a problem with `raco cross` and user scope and kept the habit. But maybe it's fixed now and I should leave my Racket 8.5 installation at user scope and give it a try. 🙂
