# Importando base de datos antigua a la última versión

**URL:** https://meta.discourse.org/t/importing-old-database-to-latest-version/227493
**Category:** Self-hosting
**Created:** [19 Mayo, 2022 13:04 UTC](https://meta.discourse.org/t/importing-old-database-to-latest-version/227493 "2022-05-19T13:04:57Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [20 Mayo, 2022 11:30 UTC](https://meta.discourse.org/t/importing-old-database-to-latest-version/227493/10 "2022-05-20T11:30:09Z")

</div>

> [@agemo](#):
>
> ¿Es la exportación/importación de administrador suficiente sin actualizar primero la base de datos antigua?

Sí, lo es, pero es posible que necesites solucionar un problema con tu base de datos actual antes de poder restaurarla en 2.9.

> [@agemo](#):
>
> ```plaintext
> duplicate key value violates unique constraint "index_poll_options_on_poll_id_and_digest"
> Key (poll_id, digest)=(163, 84b9c1be0d88b6592595e6e16827dbc1) already exists.
> 
> ```

Aquí tienes una solución que podría funcionar, pero necesitarás usar `%84b9c1be0d88b6592595e6e16827dbc1%` como `value` porque ese es el ID de encuesta que está causando problemas en tu caso.

> [@Upgrade failed with "duplicate key value violates unique constraint" error](https://meta.discourse.org/t/upgrade-failed-with-duplicate-key-value-violates-unique-constraint-error/142767/19?u=gerhard):
>
> Okay, I did the following from pgsql: SELECT \* FROM post\_custom\_fields WHERE name = 'polls' AND value LIKE '%399fc6670871474cd7ce0458401fd299%'; It displayed me one row. So, I removed it: DELETE FROM post\_custom\_fields WHERE name = 'polls' AND value LIKE '%399fc6670871474cd7ce0458401fd299%'; Note: The proper way would be to remove by row id, but since it returned just a single row I did just that. slight_smile After that I re-started upgrade and it completed successfully. Thanks to e…

---

_[View the full topic](https://meta.discourse.org/t/importing-old-database-to-latest-version/227493)._
