• Resolved skyscraper1709

    (@skyscraper1709)


    We are unable to run the sync process to completion on servers with about 4GB of ram. And every time we start the sync process gain it starts afresh. I see that the CLI commands supports the following.

    [–upper-limit-object-id=]
    Upper limit of a range of IDs to be indexed. If indexing IDs from 30 to 45, this should be 45

    [–lower-limit-object-id=]
    Lower limit of a range of IDs to be indexed. If indexing IDs from 30 to 45, this should be 30

    Could I get some insight into what the object-Ids are? How do we map posts in WP to these?

    Any suggestions on how we should attempt to run the sync by parts?

    Our main objective is to fully run the sync process for a site with tons of posts.

Viewing 1 replies (of 1 total)
  • Thread Starter skyscraper1709

    (@skyscraper1709)

    Resorted to a solution using a bash script:

    Object-id corresponds to WP post ID.
    The sync is set in backend to 10 times for every run and we are Looping 2000 items every iteration.
    So –per-page needs to be set at 200.

    Finally 2000 items every iteration of our loop.

    The code:

    
    #!/bin/bash
    #Get the most recent post ID
    last_id=$(wp post list --field=ID --posts_per_page=1 | xargs)
    #loop back till the first post 2000 at a time.
    for (( c=last_id; c>2000; c=c-2000 )); do
     d=$((c-2000));
     echo "Start: $c";
     echo "End: $d";
     # run elastic press sync by parts
     wp elasticpress sync --per-page=200 --lower-limit-object-id="$d" --upper-limit-object-id="$c"
    done
    • This reply was modified 1 year ago by skyscraper1709. Reason: code indentation
Viewing 1 replies (of 1 total)
  • The topic ‘Running Sync with limited resources does not reach to completion’ is closed to new replies.