Skip to content

Migrating from MongoDB to Postgresql #9711

Answered by balmacefa
alexandru-2016 asked this question in Q&A
Discussion options

You must be logged in to vote

You can create a script to paginate the payload v2 data. loop while nextPage is true.
send the data to the Payload v3 endpoint or using the project import.

import { getPayload } from "payload";
import { SLUGS } from "../../src/collections/Constants";
import configs from "../../src/payload.config";

type my_func = () => Promise<void>;
async function main() {
    const payload = await getPayload({
        config: configs,
    });


    const failedFiles: any[] = []; // Array para almacenar los objetos de archivos y errores




    let hasNextPage = true;
    let page = 0;
    const func_list: my_func[] = [];

    while (hasNextPage) {
        const bathDocs = await payload.find({
            

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@balmacefa
Comment options

@balmacefa
Comment options

@alexandru-2016
Comment options

Answer selected by alexandru-2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants