Import Data from LWDonation

How to Migrate Data from LWDonation to Fundrizer

Step 1: Export LWDonation Data

Export Program Data and Donation Data to computer ( program.xml & lwdonation.csv )

  1. Go to “Tool > Export”, choose “Program”, and click the Export button. The program.xml file will automatically be downloaded to your computer.
  2. Then, go to “Reports” and choose the correct cloud. The lwdonation.csv file will automatically be downloaded to your computer.
Image
Image
Step 2: Convert that data into the Fundrizer Data

Open link, make account, and make a copy of this convert

Image
Image

Perbaiki data lwdonation_fixed.

  1. Ubah Formatt Celll _user_field_phone so to Special 0, so the phone number not be simplfy
  2. Fix Missalign column, if user not filled email that should be empty and have make the _custom_field_anonim have fit columna, and all column so on
Step 3: Convert Data into WooCommerce Orders

Placeholder for aligning LWDonation data fields with Fundrizer’s structure.

Step 4: Import Data into WooCommerce

Placeholder for the data import process into Fundrizer.

to load this meta.jso you can use WordPress Console plugin

// Load and parse the JSON data
$json_data = '{
  "0480": {
    "anonim": true,
    "message": "Semoga Allah lipat gandakan rezekinya"
  }
}';

$data = json_decode($json_data, true);

// Process each entry in the JSON data
foreach ($data as $customer_note => $note_data) {
    // Create a direct database query to find orders with this customer note
    global $wpdb;
    
    // Get the correct table name based on whether HPOS is enabled
    $order_table = $wpdb->prefix . 'wc_orders';
    
    // Query for the order with this customer note
    $order_id = $wpdb->get_var(
        $wpdb->prepare(
            "SELECT id FROM $order_table WHERE customer_note = %s LIMIT 1",
            $customer_note
        )
    );
    
    if ($order_id) {
        $order = wc_get_order($order_id);
        
        if ($order) {
            // Convert anonim boolean to 0/1
                  // Convert anonim boolean to 0/1
            $anonim_value = $note_data['anonim'] === true ? 1 : 0;
            
            // Save anonim status
            $order->update_meta_data('_wc_billing/fundrizer/anonim', $anonim_value);
            
            // Save message - no need to escape as update_meta_data handles this
            $order->update_meta_data('frzr_message', $note_data['message']);
            
            // Save the changes
            $order->save();
            
            // Log success
            error_log("Updated order #$order_id with customer note '$customer_note': anonim=$anonim_value, message=" . esc_html($note_data['message']));
            echo "Updated order #$order_id with customer note '$customer_note' \n"; 
        }
    } else {
        // Log no order found for this customer note
        error_log("No order found with customer note: $customer_note");
        echo "No order found with customer note: $customer_note /n";
    }
}

echo "Processing complete!";

Step 5: Verify Data Integrity Post-Migration

Placeholder for steps to ensure data was migrated accurately.

From .zip File