> For the complete documentation index, see [llms.txt](https://docs.acpt.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.acpt.io/general/migrating-from-v1/fix-data-loss-after-migration-from-v1.md).

# Fix data loss after migration from V1

If you experienced a data loss from V1 after migration follow this guide.

{% hint style="danger" %}
Before applying the fix it is recommended to backup your DB
{% endhint %}

### Data loss in option page fields

The persisting strategies of V1 and V2 are slightly different.

Suppose you have a field `email` inside a box called `box`, associated with an option page whose slug is `new-page`.

In v1 the meta field is saved with this name:

```
box_email
```

In v2 instead, the field is saved with this name:

```
new-page_box_email
```

This is because in V2 a meta field **can be shared between several pages**.

#### How to restore the data

You need access to your DB.

You can use [PHPMyAdmin](https://www.phpmyadmin.net/), or this [plugin](https://wordpress.org/plugins/wp-phpmyadmin-extension/) instead.

If you don't see the option page meta fields, they are saved with the wrong key.

Launch this query (**use the correct WordPress tables prefix**) to seek the data saved in `box`:

```sql
SELECT * from wp_options where option_name LIKE 'box_%';
```

If you don't have records from the previous query, launch this one:

```sql
SELECT * from wp_options where option_name LIKE 'new-page_new-page_box_%';
```

In both cases, you need to restore `option_name` to the right name.

Launch this query to fix the field if you **got results from the first query**;

```sql
UPDATE wp_options set option_name = REPLACE(option_name, "box_","new-page_box_") where option_name LIKE 'box_%';
```

Instead, launch this query if you **got results from the second query**:

```sql
UPDATE wp_options set option_name = REPLACE(option_name, "new-page_new-page_box_","new-page_box_") where option_name LIKE 'new-page_new-page_box_%';
```

Now the data inside `box` should be restored.

Check it out by launching this query:

```sql
SELECT * from wp_options where option_name LIKE 'new-page_box_%';
```

You should finally see your data with the correct key.
