# Transfer data from a form database to another database

**URL:** <https://forum.wixstudio.com/t/transfer-data-from-a-form-database-to-another-database/54495>\
**Category:** Ask the community\
**Tags:** wix-forms, question, code\
**Created:** [December 11, 2023, 4:36am UTC](https://forum.wixstudio.com/t/transfer-data-from-a-form-database-to-another-database/54495 "2023-12-11T04:36:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user969](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/user969/32/80905_2.png) [@user969](https://forum.wixstudio.com/u/user969)\
**Post date:** [December 11, 2023, 4:36am UTC](https://forum.wixstudio.com/t/transfer-data-from-a-form-database-to-another-database/54495/1 "2023-12-11T04:36:12Z")

</div>

**Question:**  
I want to make it so that the user can enter an opinion in a form and that a little more base in the pages we recover this information to make a part comment but the problem is that the database of the form we authorizations blocked in admin so I thought that we can transfer its data serves another base.

**Product:**  
I’ve already started, but it didn’t work.

```js
import wixData from 'wix-data';

const baseDeDonneesSource = 'Avis';
const baseDeDonneesDestination = 'test';

const formulaireNom = $w('#wixForms1');

function onSubmit() {
  
  const formData = $w(formulaireNom).value;

 
  ajouterDonneesABaseDeDonnees(formData);
}

function ajouterDonneesABaseDeDonnees(data) {
  wixData.insert(baseDeDonneesDestination, data)
    .then((results) => {
      console.log('Données ajoutées avec succès à la base de données de destination', results);
    })
    .catch((error) => {
      console.error('Erreur lors de l\'ajout des données à la base de données de destination', error);
    });
}

$w.onReady(function () {
  $w(formulaireNom).onSubmit(onSubmit);
});

```

---

<div class="post-metadata">

**Author:** ![anthony](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/anthony/32/79536_2.png) [@anthony](https://forum.wixstudio.com/u/anthony)\
**Post date:** [December 12, 2023, 5:43pm UTC](https://forum.wixstudio.com/t/transfer-data-from-a-form-database-to-another-database/54495/2 "2023-12-12T17:43:12Z")

</div>

As long as both databases have the same structure I don’t see why you can’t do this. Are you getting an error message?

Perhaps you need to first strip out certain data like `_id` and columns related to creation time/modification time/owner as these are automatically created by the database.

I also understand that the `Avis` database is admin only. Any reason to not change its permissions to be more flexible? “Site member author” permissions for example can make it so only the creator of a row can edit it in the future. [CMS: Collection Permissions Overview | Help Center | Wix.com](https://support.wix.com/en/article/cms-collection-permissions-overview)
