Answers.Body: <p>This sounds like a bug, you should probably report it directly to support@craftcms.com.</p>
  
  <p>I'm posting this as an answer however, because you may be able to skirt the issue... Try updating to Craft 3.0.x <em>first</em>, and then updating the 3.1.x from there.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-05T21:44:24.497Z
Answers.Text: Thanks @lindsey-d downgrading to 3.0.x worked, didn't think of trying that. For anyone that has the same issue I updated `composer.json` and changed Craft to `"craftcms/cms": "~3.0.0",` then ran `composer update`.
Answers.UserDisplayName: Simon Davies
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-04T20:16:40.753Z
Answers.LastActivityDate: 2019-02-04T20:16:40.753Z
Answers.UserDisplayName: Lindsey D
Body: <p>I'm working on upgrading a site from Craft2 to Craft3. I've run through the steps in the <a href="https://docs.craftcms.com/v3/upgrade.html#performing-the-upgrade" rel="nofollow noreferrer">upgrade guide</a> and when I go to <code>/admin</code> and press the button to run the Database upgrade I get the following error.</p>
  
  <pre><code>Integrity constraint violation: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'createfoldersinvolume:bb790fdf-3d6b-46b8-a023-b9f7ffe8aba5' for key 'craft_userpermissions_name_unq_idx'
  The SQL being executed was: UPDATE craft_userpermissions SET name='createfoldersinvolume:bb790fdf-3d6b-46b8-a023-b9f7ffe8aba5', dateUpdated='2019-02-04 17:39:32' WHERE id=173
  
  Migration: craft\migrations\m180518_173000_permissions_to_uid
  
  </code></pre>
  
  <p>I can restore the database so that's fine but not sure how best to proceed with the upgrade. Any help would be appreciated!</p>
  
Tags: <craft3><upgrades>
Title: Upgrading Craft 2 to 3 hits database error
ThreadText: # Upgrading Craft 2 to 3 hits database error
  
  (Asked by: username_0 on 2019-02-04)
  
  I'm working on upgrading a site from Craft2 to Craft3. I've run through the steps in the [upgrade guide](https://docs.craftcms.com/v3/upgrade.html#performing-the-upgrade) and when I go to `/admin` and press the button to run the Database upgrade I get the following error.
  
  ```
  Integrity constraint violation: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'createfoldersinvolume:bb790fdf-3d6b-46b8-a023-b9f7ffe8aba5' for key 'craft_userpermissions_name_unq_idx'
  The SQL being executed was: UPDATE craft_userpermissions SET name='createfoldersinvolume:bb790fdf-3d6b-46b8-a023-b9f7ffe8aba5', dateUpdated='2019-02-04 17:39:32' WHERE id=173
  
  Migration: craft\migrations\m180518_173000_permissions_to_uid
  
  ```
  
  I can restore the database so that's fine but not sure how best to proceed with the upgrade. Any help would be appreciated!
  
  **Tags:** craft3, upgrades
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-02-04. Score: 1
  
  This sounds like a bug, you should probably report it directly to support@craftcms.com.
  
  I'm posting this as an answer however, because you may be able to skirt the issue... Try updating to Craft 3.0.x *first*, and then updating the 3.1.x from there.
  
  > **Comments:**
  > **username_0**: Thanks @username_1-d downgrading to 3.0.x worked, didn't think of trying that. For anyone that has the same issue I updated `composer.json` and changed Craft to `"craftcms/cms": "~3.0.0",` then ran `composer update`.  
  
  ---
  
  