Products1-Stream Panel Database Migration
1-Stream Panel Database Migration
One-time

1-Stream Panel Database Migration

Move your 1-Stream panel database to Xtream-Masters or another panel: channels, movies, series, lines, resellers and more. The migration runs automatically from your client area, usually in minutes.

$99one-time payment
General info: WhatsApp
Technical support: Open a ticket

Check your database size first

The price depends on how big your 1-Stream database is. Run the backup now, the script prints the size, then pick the matching plan.

1
Run the backup on your 1-Stream server

Paste the script into SSH and press Enter. It reads your own panel config, so there is nothing to fill in. The last lines print the file size and a link.

Watch the video guide
View script
cat > /root/xm-backup.sh <<'XMEOF'
#!/bin/bash
# Xtream-Masters - 1-Stream backup helper.
# Reads your panel's own config, so there is nothing to fill in by hand.
# Re-run with:  bash /root/xm-backup.sh --reset-password
set -u

say()  { printf '%s\n' "$*"; }
die()  { printf '\n [X] %s\n\n' "$*" >&2; exit 1; }

[ "$(id -u)" = "0" ] || die "Run this as root."
command -v pg_dump >/dev/null 2>&1 || die "pg_dump is not installed on this server."

RESET=0
[ "${1:-}" = "--reset-password" ] && RESET=1

# ---- 1. find the panel config -------------------------------------------
CFG=""
for f in /home/onestream/iptv/config.php /home/onestream/iptv/config.php.backup \
         /home/onestream/config.php /home/onestream/config.php.backup; do
    [ -f "$f" ] && CFG="$f" && break
done
[ -n "$CFG" ] || CFG=$(find /home/onestream -maxdepth 4 -name 'config.php' 2>/dev/null | head -1)
[ -n "$CFG" ] || die "Could not find your 1-Stream config.php."

val() { sed -n "s/.*'$1'[[:space:]]*=>[[:space:]]*[\"']\{0,1\}\([^\"',]*\).*/\1/p" "$CFG" | head -1; }
DBH=$(val db_host); DBP=$(val db_port); DBN=$(val db_database)
DBU=$(val db_username); DBW=$(val db_password)
[ -n "$DBH" ] || DBH=127.0.0.1
[ -n "$DBP" ] || DBP=5272
[ -n "$DBU" ] || DBU=streaming
[ -n "$DBN" ] || die "Could not read the database name from $CFG"
say " [1/5] config  : $CFG"
say "       database: $DBU@$DBH:$DBP/$DBN"

# ---- 2. optional password reset -----------------------------------------
# Only runs when asked for. The new password is written back into the config
# in the same step, otherwise the panel itself would stop connecting.
if [ "$RESET" = "1" ]; then
    NEWPW=$(head -c 12 /dev/urandom | od -An -tx1 | tr -d ' \n')
    say " [*] resetting the database password"
    sudo -u postgres psql -p "$DBP" -c "ALTER USER \"$DBU\" WITH PASSWORD '$NEWPW';" >/dev/null 2>&1 \
        || die "Reset failed. Run it by hand:
       sudo -u postgres psql -p $DBP -c \"ALTER USER $DBU WITH PASSWORD 'yourpass';\""
    for f in /home/onestream/iptv/config.php /home/onestream/iptv/config.php.backup; do
        [ -f "$f" ] || continue
        cp -a "$f" "/root/xm-config-backup-$(basename "$f")-$(date +%Y%m%d%H%M%S)"
        sed -i "s|'db_password'[[:space:]]*=>.*|'db_password' => \"$NEWPW\",|" "$f"
        say "     updated $f"
    done
    DBW="$NEWPW"
    say "     new password: $NEWPW"
fi

# ---- 3. connect ----------------------------------------------------------
# Two ways in, so a stale password in the config is not a dead end: the normal
# TCP login, then the local postgres system account, which needs no password.
MODE=""
export PGPASSWORD="$DBW"
if psql -h "$DBH" -p "$DBP" -U "$DBU" -d "$DBN" -tAc 'SELECT 1' >/dev/null 2>&1; then
    MODE=tcp
elif sudo -u postgres psql -p "$DBP" -d "$DBN" -tAc 'SELECT 1' >/dev/null 2>&1; then
    MODE=peer
    say " [!] the password in your config did not work - using the local"
    say "     postgres account instead (no password needed)"
fi

if [ -z "$MODE" ]; then
    say ""
    say " [X] Could not log in to the database."
    say ""
    say "     Reset the password and retry, both in one go:"
    say ""
    say "         bash /root/xm-backup.sh --reset-password"
    say ""
    die "Nothing has been changed."
fi
say " [2/5] connected via $MODE"

# ---- 4. dump -------------------------------------------------------------
OUTDIR=""
for d in /home/onestream/iptv/public /home/onestream/public /var/www/html /usr/share/nginx/html; do
    [ -d "$d" ] && OUTDIR="$d" && break
done
[ -n "$OUTDIR" ] || die "Could not find your public web folder."

# Random name: this file holds your whole customer database and sits in a
# public folder until you delete it, so it should not be guessable.
TOKEN=$(head -c 9 /dev/urandom | od -An -tx1 | tr -d ' \n')
OUT="$OUTDIR/xm-$TOKEN.sql"

say " [3/5] writing  : $OUT"
say "       this can take a few minutes on a large panel, please wait"

DUMP_ARGS="--quote-all-identifiers --no-acl --no-owner \
    --exclude-table=api_access_tokens \
    --exclude-table=automated_subsription_messages \
    --exclude-table=automated_subsription_messages_types \
    --exclude-table=auto_block_restrictions \
    --exclude-table=auto_block_settings \
    --exclude-table=contacts \
    --exclude-table=credits_history_reasons \
    --exclude-table=dashboard_messages \
    --exclude-table=dashboard_messages_roles \
    --exclude-table=device_events \
    --exclude-table=epg_data \
    --exclude-table=external_servers \
    --exclude-table=external_servers_status \
    --exclude-table=file_data_imports \
    --exclude-table=file_data_import_records \
    --exclude-table=general_security_restrictions \
    --exclude-table=general_security_restriction_reasons \
    --exclude-table=general_security_restriction_scopes \
    --exclude-table=general_security_restriction_types \
    --exclude-table=general_security_whitelists \
    --exclude-table=integration_transactions \
    --exclude-table=ip_to_location \
    --exclude-table=lines_proxies \
    --exclude-table=lines_proxy_groups \
    --exclude-table=lines_proxy_group_detection \
    --exclude-table=line_activity \
    --exclude-table=line_connection_stats \
    --exclude-table=line_restriction_types \
    --exclude-table=migrations \
    --exclude-table=migration_history \
    --exclude-table=migration_logs \
    --exclude-table=notices \
    --exclude-table=notices_notice_integrations \
    --exclude-table=notice_channels \
    --exclude-table=notice_channels_integrations \
    --exclude-table=notice_channel_types \
    --exclude-table=notice_integration \
    --exclude-table=notice_integration_types"

if [ "$MODE" = "tcp" ]; then
    # shellcheck disable=SC2086
    pg_dump -h "$DBH" -p "$DBP" -U "$DBU" -d "$DBN" $DUMP_ARGS -f "$OUT" || die "pg_dump failed."
else
    # shellcheck disable=SC2086
    sudo -u postgres pg_dump -p "$DBP" -d "$DBN" $DUMP_ARGS > "$OUT" || die "pg_dump failed."
fi

# ---- 5. verify -----------------------------------------------------------
[ -s "$OUT" ] || die "The backup came out empty."
tail -c 400 "$OUT" | grep -q 'PostgreSQL database dump complete' \
    || die "The backup is incomplete - it stopped early. Check free disk space with 'df -h' and run this again."
chmod 644 "$OUT"

SIZE=$(du -h "$OUT" | cut -f1)
IP=$(curl -fsS -m 8 https://api.ipify.org 2>/dev/null)
[ -n "$IP" ] || IP=$(hostname -I 2>/dev/null | awk '{print $1}')
[ -n "$IP" ] || IP="your-server-ip"

say " [4/5] verified : complete dump, $SIZE"
say " [5/5] done"
say ""
say " ============================================================"
say "  Paste this link into your order page:"
say ""
say "    http://$IP/xm-$TOKEN.sql"
say ""
say "  Delete it once your migration has finished:"
say "    rm -f $OUT"
say " ============================================================"
XMEOF
bash /root/xm-backup.sh

Keep the link the script prints. You paste it on your order page after payment and the migration starts on its own.

2
Pick the plan that covers your size

The size you buy is checked automatically when you submit your backup.

Bought the smaller plan and your backup turned out bigger? Your order page prices the difference and you carry on. No support ticket.

Product details

How it works

  1. Create your backup. Copy the script on this page and run it on your 1-Stream server. It prints your database size and a link.
  2. Buy the plan that covers your size. Up to 1 GB, or 1 GB to 5 GB. The size you buy is checked automatically when you submit the backup.
  3. Paste the link. On your order page. We check it before starting and tell you straight away if anything is wrong.
  4. We migrate it. You can close the page, the job keeps running and your order shows live progress.
  5. Download. You get a compressed, ready-to-import database with the import command included, kept for 7 days.

Pricing

Database sizePriceWhat is included
Up to 1 GB$99Standard migration, delivered automatically from your client area.
1 GB to 5 GB$149Larger databases. Pick this plan at checkout, nothing else changes.
Size is measured on the backup file the script above produces. Run it before you buy: it prints the size, so you know which plan to pick. It already excludes log tables, so a large panel is usually much smaller once exported.

What gets migrated

CategoryDetailsStatus
Live channelsAll live streams with their sources and server assignmentsMigrated
Created channelsUser-generated / custom channelsMigrated
MoviesFull VOD library with sourcesMigrated
Series & episodesSeries, seasons and every episodeMigrated
TMDB metadataPosters, backdrops, cast, ratings and descriptions for VOD and seriesMigrated
Lines (users)Subscriber lines with their bouquets and connection limitsMigrated
Reseller accountsResellers and their user groupsMigrated, password reset required
Reseller credit logsFull credit historyMigrated
BouquetsBouquets with their channel, movie and series assignmentsMigrated
CategoriesStream categories and content organisationMigrated
PackagesSubscription packages and their restrictionsMigrated
MAC devicesRegistered MAG / STB devicesMigrated
Stream providersConfigured provider sourcesMigrated
Streaming serversServer records and their settingsMigrated
Watch foldersWatch folder paths and configurationMigrated
User groupsRoles and permission groupsMigrated
EPGGuide sources, their XMLTV links and every channel mapping, re-attached to your channelsMigrated
Activity & connection logsLine activity, connection statistics, other logsNot migrated, excluded on purpose to keep the database small and fast
Before you order: reseller passwords cannot be carried over from 1-Stream and must be reset after import. EPG sources and channel mappings do come across; the panel downloads the guide data itself on its next update.

Good to know

  • Delivery: automatic. Most databases are converted within minutes of submitting the link.
  • File retention: your migrated database stays available for 7 days. Please download and keep your own copy.
  • Wrong file: we validate the backup before starting. If it is not a valid 1-Stream backup, we tell you why and you can submit a corrected link at no extra charge.
  • One migration per order: each order covers one database. To migrate a second panel, place another order or contact support.
  • Privacy: your backup is downloaded once, converted, and deleted from our servers when the job finishes. Each migration runs in isolation, so no other customer's data is ever included in your file.
  • Panel compatibility: you receive a standard MySQL database in the Xtream-Codes structure, which imports into Xtream-Masters, XUI.ONE, StreamCreed, XtreamUI and other panels built on the same schema. Tell us which panel you are moving to and we will confirm before you order.

FAQ

How long does it take?
Most migrations finish in a few minutes. Very large databases take longer, and your order page shows live progress the whole time.
Do I need to keep the page open?
No. The migration runs on our servers, so you can close the page and come back whenever you like.
My database is bigger than 1 GB. What do I do?
Pick the 1 GB to 5 GB plan at checkout, $149. Already bought the smaller plan? Your order page prices the difference and the migration carries on. No ticket.
How do I reach support?
Telegram @xtreamMasters, WhatsApp +44 7307 530066 or support@xtream-masters.com. Hours: 1 PM to 10 PM Europe time, closed Fridays.
$99one-time payment
$99one-time payment
1-Stream Panel Database Migration $99 one-time payment
Preparing your order...