# Migrating packages from previous installs in DrRacket

**URL:** <https://racket.discourse.group/t/migrating-packages-from-previous-installs-in-drracket/1719>\
**Category:** General\
**Tags:** drracket\
**Created:** [February 16, 2023, 6:48pm UTC](https://racket.discourse.group/t/migrating-packages-from-previous-installs-in-drracket/1719 "2023-02-16T18:48:19Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![richb-hanover](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/richb-hanover/32/874_2.png) [@richb-hanover](https://racket.discourse.group/u/richb-hanover)\
**Post date:** [February 15, 2023, 10:33pm UTC](https://racket.discourse.group/t/migrating-packages-from-previous-installs-in-drracket/1719/1 "2023-02-15T22:33:09Z")

</div>

[Follow-up to my question above about a minimal process for upgrading...](https://racket.discourse.group/t/racket-version-8-7-is-now-available/1478/5)

I took the opportunity to upgrade to Racket v8.8 (from v8.7). I'm using macOS Monterey 12.6.3. I dragged the `Racket v8.8` folder from the .dmg into the `/Applications/Tools-Developer` folder on my hard drive. I double-clicked the DrRacket.app icon and saw this:

 ![image](https://global.discourse-cdn.com/free1/uploads/racket/original/2X/d/d3552acd4540d0a9de60371fcfcd9cebb117319e.jpeg)

I then made some false starts, but I believe the proper next steps are:

- File -\> Package Manager...
- Click the "Copy from Version" tab
- Select the previous version Racket
- Click the "Copy from Version" button

I suspect quitting and re-launching Racket would make it all work. I'll review/update this procedure when Racket v8.9 comes out 🙂

---

<div class="post-metadata">

**Author:** ![sorawee](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@sorawee](https://racket.discourse.group/u/sorawee)\
**Post date:** [February 16, 2023, 1:07am UTC](https://racket.discourse.group/t/migrating-packages-from-previous-installs-in-drracket/1719/2 "2023-02-16T01:07:57Z")

</div>

Ah, the problem here is not related to Quickscript that I previously suggested. Rather, it’s a combination of two things:

1. You previously used `#lang br` in DrRacket on the version 8.7. DrRacket helpfully remembers the most recently used `#lang` in `~/Library/Preferences/org.racket-lang.prefs.rktd`, so that when you open a new empty buffer, the `#lang` will automatically be placed for convenience.

2. When you open a new empty buffer, the program will be run immediately. This is so that the REPL is loaded with the `#lang` environment, allowing you to use the REPL right away.

The issue is that after you freshly install the version 8.8, `#lang br` wouldn’t be installed yet, so when you open DrRacket, the automatic running causes the failure that you saw.

The heuristics to run a new empty buffer to load a `#lang` seems problematic to me. It has caused many other issues before. See [https://github.com/mbutterick/pollen/issues/268](https://github.com/mbutterick/pollen/issues/268) and [https://github.com/racket/drracket/issues/555](https://github.com/racket/drracket/issues/555). I think it would be nice to revisit the heuristics and see if it’s actually needed, or if there’s anything we can do in a more principled manner.

---

<div class="post-metadata">

**Author:** ![robby](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/robby/32/7_2.png) [@robby](https://racket.discourse.group/u/robby)\
**Post date:** [February 16, 2023, 1:20am UTC](https://racket.discourse.group/t/migrating-packages-from-previous-installs-in-drracket/1719/3 "2023-02-16T01:20:23Z")

</div>

> [@sorawee](#):
>
> The heuristics to run a new empty buffer to load a `#lang` seems problematic to me ...

The goal is to get an interactions window that doesn't error (and isn't #lang racket/base or something like that) without having to run the program. I'm happy to try other approaches, for sure.

---

<div class="post-metadata">

**Author:** ![joeld](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/joeld/32/38_2.png) [@joeld](https://racket.discourse.group/u/joeld)\
**Post date:** [February 16, 2023, 2:42am UTC](https://racket.discourse.group/t/migrating-packages-from-previous-installs-in-drracket/1719/4 "2023-02-16T02:42:12Z")

</div>

I would still very much like this behavior to be something that is opted into and controlled at the #lang level. I find it annoying, to put it bluntly. When I want code to run I will run it.

---

<div class="post-metadata">

**Author:** ![robby](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/robby/32/7_2.png) [@robby](https://racket.discourse.group/u/robby)\
**Post date:** [February 16, 2023, 4:58am UTC](https://racket.discourse.group/t/migrating-packages-from-previous-installs-in-drracket/1719/5 "2023-02-16T04:58:24Z")

</div>

Well, turning it off would be easy enough to do, for sure.

---

<div class="post-metadata">

**Author:** ![gus-massa](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/gus-massa/32/507_2.png) [@gus-massa](https://racket.discourse.group/u/gus-massa)\
**Post date:** [February 16, 2023, 4:17pm UTC](https://racket.discourse.group/t/migrating-packages-from-previous-installs-in-drracket/1719/6 "2023-02-16T16:17:49Z")

</div>

Is it possible on startup to show the loaded environment when there is no error, but in case of an error eat the error and show a empty text box?

(Obviously, when the user clicks the "run" button, DrRacket must show the error.)

---

<div class="post-metadata">

**Author:** ![sorawee](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@sorawee](https://racket.discourse.group/u/sorawee)\
**Post date:** [February 16, 2023, 4:47pm UTC](https://racket.discourse.group/t/migrating-packages-from-previous-installs-in-drracket/1719/7 "2023-02-16T16:47:04Z")

</div>

That’s… even more heuristics. Though my biggest gripe is that currently DrRacket [hard codes Pollen](https://github.com/racket/drracket/blob/master/drracket/drracket/private/rep.rkt#L1850) as an exception for the automatic running, which… doesn’t seem like the Right Thing(tm) to do. I would hope for a more extensible approach, along the line that @joeld mentioned.

---

<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:** [February 16, 2023, 4:53pm UTC](https://racket.discourse.group/t/migrating-packages-from-previous-installs-in-drracket/1719/8 "2023-02-16T16:53:00Z")

</div>

To meet the goal of having a working interactions window at startup, would another workable solution be to to the following as part of installation? or on a prompt the first time DrRacket is started?

1. _Configure Command Line for Racket..._
2. Detect the previous installed version
3. If previous version exists run `raco pkg migrate < previous installed version>`

Stephen

---

<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:** [February 16, 2023, 5:30pm UTC](https://racket.discourse.group/t/migrating-packages-from-previous-installs-in-drracket/1719/9 "2023-02-16T17:30:57Z")

</div>

Assuming _Configure Command Line_ has side effects like writing to  
shell configuration files or similar, I would (personally) not want  
that to happen automatically.

---

<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:** [February 16, 2023, 5:32pm UTC](https://racket.discourse.group/t/migrating-packages-from-previous-installs-in-drracket/1719/10 "2023-02-16T17:32:06Z")

</div>

> [@spdegabrielle](#):
>
> on a prompt the first time DrRacket is started?

Not even as a prompt?

---

<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:** [February 16, 2023, 6:06pm UTC](https://racket.discourse.group/t/migrating-packages-from-previous-installs-in-drracket/1719/11 "2023-02-16T18:06:51Z")

</div>

Acceptable 🙂 but possibly as an option? Assuming I have the command-line set up properly, I might want DrR to just do the `raco pkg migrate` part.
