Skip to content

Import Subscriber

Overview

Subscriber Import allows you to bulk import subscribers from a CSV file instead of adding them one by one. The system supports two import methods: Frontend Import (synchronous, immediate processing) and Backend Import (queue-based, for large files).

WHAT IS SUBSCRIBER IMPORT?

Subscriber Import is a bulk data entry feature that:

  • Two Import Methods - Frontend (immediate) or Backend (queue)
  • CSV File Upload - Import hundreds or thousands of subscribers
  • Automatic Activation - Activates subscribers during import
  • Duplicate Handling - Updates existing, creates new
  • Failed Import Logs - Track and fix failed records

Perfect for: Initial setup, bulk migrations, data transfers, large-scale onboarding!


📋 Table of Contents

  1. Two Import Types
  2. CSV File Requirements
  3. Required Fields
  4. Optional Fields
  5. How to Prepare CSV File
  6. Import Process
  7. Failed Import Logs
  8. Best Practices

Two Import Types

Type 1: Frontend Import (Synchronous)

What It Is:

  • Processes immediately in browser
  • Synchronous processing
  • Shows results right away
  • Best for small to medium files

When to Use:

✅ Small files (< 500 subscribers)
✅ Need immediate results
✅ Want to see errors right away
✅ Testing import file

Limitations:

❌ Browser timeout for large files
❌ May freeze browser
❌ Limited to ~1000 subscribers
❌ Requires staying on page

Processing:

  • Batch size: 50 subscribers per batch
  • Memory limit: 1GB
  • Time limit: 30 minutes
  • Immediate feedback

Type 2: Backend Import (Queue)

What It Is:

  • Processes in background queue
  • Asynchronous processing
  • Starts after 1 minute delay
  • Best for large files

When to Use:

✅ Large files (> 500 subscribers)
✅ Thousands of subscribers
✅ Don't need immediate results
✅ Production imports

Advantages:

✅ No browser timeout
✅ Can close browser
✅ Handles unlimited subscribers
✅ Better performance

Processing:

  • Starts: 1 minute after upload
  • Queue: Background job
  • Memory limit: 1GB
  • Time limit: 30 minutes
  • Check logs for progress

CSV File Requirements

File Format

Accepted Format:

  • CSV (Comma Separated Values)
  • UTF-8 encoding recommended
  • Maximum file size: 5MB

Column Structure:

  • Must have at least 30 columns
  • Header row required
  • Exact column names required
  • Case-sensitive

Required Columns (14 columns)

These columns MUST be present:

  1. isp_id
  2. branch_id
  3. full_name
  4. username
  5. password
  6. connection_password
  7. identity
  8. email
  9. phone
  10. connection_type
  11. nas_id
  12. salesperson_id
  13. package_id
  14. expiration_date

Missing any required column will cause import to fail!


Required Fields

1. isp_id (Required)

What: ISP ID from your system Format: Integer Example: 1Why Required: Identifies which ISP this subscriber belongs to How to Get: Check ISP settings or database


2. branch_id (Required)

What: Branch ID from your system Format: Integer Example: 1Why Required: Identifies which branch this subscriber belongs to How to Get: Check Branch settings Validation: Must belong to the ISP


3. full_name (Required)

What: Subscriber's full name Format: Text Example: John DoeWhy Required: Identifies the subscriber Validation: Cannot be empty


4. username (Required)

What: Unique login username Format: Alphanumeric (no spaces) Example: john_doe123Why Required: Used for login and Radius authentication Validation:

  • Must be unique
  • If exists: Updates existing subscriber
  • If new: Creates new subscriber

5. password (Required)

What: Portal login password Format: Text Example: MySecure123Why Required: For portal/dashboard access Processing: Hashed before storage


6. connection_password (Required)

What: PPPoE/Hotspot connection password Format: Text Example: Connect123Why Required: Used for internet connection (PPPoE/Hotspot) Fallback: If empty, uses password field Stored In: Radius database (Cleartext-Password)


7. identity (Required)

What: National ID or identity number Format: Text/Number Example: 1234567890Why Required: Subscriber identification Validation: Cannot be empty


8. email (Required)

What: Email address Format: Valid email Example: [email protected]Why Required: Communication and notifications Validation:


9. phone (Required)

What: Phone number Format: Numbers only (+ allowed) Example: +8801712345678 or 01712345678Why Required: Communication and verification Validation: Only numbers and + allowed


10. connection_type (Required)

What: Type of internet connection Format: Integer (1-5) Options:

  • 1 = Radius PPPoE
  • 2 = Radius Hotspot
  • 3 = API PPPoE
  • 4 = API Hotspot
  • 5 = API Static

Example: 1Why Required: Determines how subscriber connects


11. nas_id (Required)

What: Network Access Server ID Format: Integer Example: 5Why Required: Identifies which NAS handles this subscriber How to Get: Check Network → NAS Details Validation: Must exist in system


12. salesperson_id (Required)

What: Salesperson/Reseller ID Format: Integer Example: 10Why Required: Assigns subscriber to salesperson Override: Can be overridden during import Validation: Package must be assigned to this salesperson


13. package_id (Required)

What: Internet package ID Format: Integer Example: 3Why Required: Assigns package and activates subscriber How to Get: Check Package module Validation: Must be assigned to salesperson


14. expiration_date (Required)

What: Service expiration date Format: d M Y H:i:s or valid timestamp Example: 01 Jan 2025 23:59:59Why Required: Sets when service expires Processing:

  • Stored in subscriber table
  • Stored in Radius (Expiration attribute)
  • Used for auto-activation

Optional Fields

Location Fields

country_id - Country ID (integer) province_id - Province ID (integer) city_id - City ID (integer) area_id - Area ID (integer) subarea_id - Subarea ID (integer)


Network Infrastructure Fields

box_number - Distribution box number box_address - Box location address switch_board - Switch board name/number switch_port - Port number on switch uplink_port - Uplink port number fiber_code - Fiber cable code fiber_color - Fiber cable color cable_type - Type of cable used electric_socket - Power source info


Technical Fields

static_ip - Static IP address (if assigned) mac_address - MAC address (comma-separated for multiple) onu_note - ONU/ONT notes department - Department name latitude - GPS latitude longitude - GPS longitude


Status & Quota Fields

profile_status - Profile status (1=Register, 2=Active, 3=Disable, 4=Terminated) sms_status - SMS notification status (0=Off, 1=On) mac_lock_status - MAC address lock status total_data_quota - Total data quota (MB) used_data_quota - Used data quota (MB) total_session_quota - Total session time (minutes) used_session_quota - Used session time (minutes)


Discount Fields

discount_type - Discount type (1=Percentage, 2=Fixed) discount - Discount amount


Other Fields

address - Street address join_date - Join date (Y-m-d H:i:s format) previous_balance - Previous balance (admin only, for new subscribers)


How to Prepare CSV File

Step 1: Download Template

  1. Go to Subscriber → Import
  2. Download CSV template (if available)
  3. Or create new CSV with required columns

Step 2: Add Column Headers

First row must contain exact column names:

csv
isp_id,branch_id,full_name,username,password,connection_password,identity,email,phone,connection_type,nas_id,salesperson_id,package_id,expiration_date,...

Step 3: Fill Data Rows

Example row:

csv
1,1,John Doe,john_doe,Pass123,Connect123,1234567890,[email protected],+8801712345678,1,5,10,3,01 Jan 2025 23:59:59

Step 4: Validate Data

Check:

  • ✅ All required fields filled
  • ✅ Usernames are unique
  • ✅ Email format valid
  • ✅ Phone numbers valid
  • ✅ IDs exist in system
  • ✅ Dates in correct format
  • ✅ No special characters in username

Step 5: Save as CSV

Save settings:

  • Format: CSV (Comma delimited)
  • Encoding: UTF-8
  • Delimiter: Comma (,)
  • Text qualifier: " (double quote)

Import Process

Step 1: Access Import Page

  1. Go to Subscriber menu
  2. Click "Import Subscriber"
  3. Import form appears

Step 2: Select Import Type

Frontend Import:

  • Select "Frontend Import" (Type 1)
  • For small files (< 500 subscribers)
  • Immediate processing

Backend Import:

  • Select "Backend Import" (Type 2)
  • For large files (> 500 subscribers)
  • Queue processing

Step 3: Select Salesperson (Optional)

Override Salesperson:

  • Select salesperson from dropdown
  • Overrides salesperson_id in CSV
  • Applies to all subscribers in file

Use CSV Salesperson:

  • Leave dropdown empty
  • Uses salesperson_id from CSV
  • Different salesperson per subscriber

Step 4: Upload CSV File

  1. Click "Choose File"
  2. Select your CSV file
  3. File size must be < 5MB
  4. File must be CSV format

Step 5: Submit Import

Frontend Import:

  1. Click "Import" button
  2. Wait for processing (don't close browser)
  3. See results immediately
  4. Check success/error message

Backend Import:

  1. Click "Import" button
  2. Job dispatched message appears
  3. Can close browser
  4. Check logs after 1 minute

Step 6: Review Results

Success Message:

Import Processed X Rows.

Partial Success:

Import Processed X Rows. Y Records Failed To Import. 
Check Failed Imports Logs For Details.

Error:

Invalid CSV File: Missing required columns: ...

Failed Import Logs

What Gets Logged

Failed imports are logged with:

  • Subscriber username
  • Error message
  • Import status (Failed)
  • Action by (who imported)
  • Timestamp

Common Failure Reasons

1. Invalid ISP ID

Error: CSV Import: Invalid ISP ID
Fix: Check ISP ID exists in system

2. Invalid Branch ID

Error: CSV Import: Invalid Branch ID
Fix: Check Branch ID belongs to ISP

3. Invalid Package/Salesperson

Error: CSV Import: Invalid Package ID Or Salesperson ID
Fix: Ensure package is assigned to salesperson

4. Invalid Phone Number

Error: CSV Import: Invalid Phone Number
Fix: Use only numbers and + symbol

5. Email Already Exists

Warning: Email Already Exists, Using Alternate: [email protected]
Fix: System auto-generates unique email

How to View Failed Logs

  1. Go to Subscriber → Import
  2. View "Failed Imports" tab
  3. See all failed records
  4. Review error messages
  5. Fix data and re-import

Clear Failed Logs

  1. Go to Failed Imports page
  2. Click "Clear All" button
  3. Confirms deletion
  4. All failed logs removed

Best Practices

Before Import

1. Validate CSV File

✅ Check all required columns present
✅ Verify data format correct
✅ Test with small sample first
✅ Backup existing data

2. Verify System Data

✅ ISP and Branch IDs exist
✅ Packages assigned to salesperson
✅ NAS configured properly
✅ Salesperson accounts active

3. Choose Right Import Type

✅ Frontend: < 500 subscribers
✅ Backend: > 500 subscribers
✅ Test with frontend first
✅ Use backend for production

During Import

Frontend Import:

✅ Don't close browser
✅ Don't navigate away
✅ Wait for completion
✅ Monitor progress

Backend Import:

✅ Can close browser after upload
✅ Check logs after 1 minute
✅ Monitor queue status
✅ Check failed imports

After Import

1. Verify Import Success

✅ Check subscriber count
✅ Review failed imports
✅ Fix failed records
✅ Re-import if needed

2. Activate Subscribers

✅ Subscribers auto-activated if profile_status = 2
✅ Check Radius activation
✅ Verify expiration dates
✅ Test connections

3. Review Data

✅ Check subscriber profiles
✅ Verify package assignments
✅ Confirm salesperson assignments
✅ Test login credentials

Summary

Subscriber Import is a powerful bulk data entry feature that:

✅ Two Import Methods:

  • Frontend: Immediate, synchronous (< 500 subscribers)
  • Backend: Queue-based, asynchronous (> 500 subscribers)

✅ CSV File Requirements:

  • 14 required columns
  • 30+ total columns
  • UTF-8 encoding
  • Maximum 5MB

✅ Automatic Processing:

  • Creates new subscribers
  • Updates existing subscribers
  • Activates subscribers
  • Handles duplicates

✅ Error Handling:

  • Logs failed imports
  • Detailed error messages
  • Easy to fix and re-import
  • No data loss

✅ Flexible Configuration:

  • Override salesperson
  • Batch processing
  • Memory management
  • Transaction safety

Perfect for ISPs wanting to bulk import subscribers efficiently with comprehensive error handling and flexible processing options!

www.onezeroart.com