Docs
RARX Phone cover

RARX Phone · Guides

Migrate from LB Phone

Copy your players' LB Phone data (numbers, contacts, messages, gallery, mail, social apps and more) into rarx_phone with the rarxphone_migrarlb command.

  • Qbox
  • QBCore
  • ESX
  • v2.0.0
  • rarx_phone

Overview#

rarx_phone includes a migration tool for LB Phone data, run with the server console command rarxphone_migrarlb. It never runs on its own: it only does something when you type the command.

LB's phone_* tables are only read. They are never modified or deleted, so LB stays intact in case you need to go back.

Step by step#

  1. Plan a maintenance window

    No players online and lb-phone stopped. If LB is still running, anything written after the migration will not reach rarx_phone. Running the command again later copies only the new data, but it is better to do it in one go.

  2. Start rarx_phone

    Run ensure rarx_phone. On start it creates any of its missing tables, including the control table rarx_phone_lb_import.

  3. Check the number format

    By default rarx_phone uses the same 10-digit format as LB ('({3}) {3}-{4}', Length = 7, prefixes 205, 907, 480, 520, 602), so migrated numbers are kept as they are. If you changed Config.PhoneNumber, set it back to those values before migrating.

    Optional: set Config.Mail.Domain to the mail domain you used in LB, so new accounts share the domain of the migrated ones.

  4. Run a simulation

    In the server console:

    Text
    rarxphone_migrarlb

    This is the same as rarxphone_migrarlb simular. It writes nothing. For each block it reports what it would copy, how many rows per table, what was already migrated, what is skipped and any conflicts (for example, a number or username that already belongs to another character in rarx_phone). Read the whole output.

  5. Back up the database

    Shell
    mysqldump --single-transaction --routines --triggers -u USER -p DATABASE > backup_before_migrarlb.sql
  6. Execute

    Type the command twice within 60 seconds:

    Text
    rarxphone_migrarlb ejecutar
    rarxphone_migrarlb ejecutar

    The first time it shows the simulation again and asks for confirmation; the second time it copies. If more than 60 seconds pass, or you change the blocks between both runs, it asks for confirmation again.

  7. Review the result

    Check the console (terminado: N elementos copiados, 0 con error). If something fails, the message names the item. Run the command again once it is fixed: repeating never duplicates anything.

  8. Stop starting lb-phone

    Edit server.cfg so lb-phone is no longer started.

Only some blocks#

Text
rarxphone_migrarlb simular contactos,mensajes
rarxphone_migrarlb ejecutar contactos,mensajes

If you migrate mensajes, llamadas or anuncios without numeros, also migrate numeros (before or after). That data belongs to the LB line, and if the character does not have that line in rarx_phone it will not show as theirs. The simulation warns about this.

Blocks: numeros, ajustes, pin, contactos, llamadas, mensajes, galeria, notas, correo, alarmas, buzon, grabadora, mapa, rrx, birdy, anuncios, darkchat, crypto.

todo (or no block at all) means every block except pin. Aliases are also accepted, for example fotos, twitter, instapic, pages, marketplace, cripto.

  • No mode, or simular: dry run, writes nothing.
  • ejecutar: copies the data after a second confirmation within 60 seconds.
  • blocks: comma or space separated list; defaults to todo.

Permissions: server console, or an admin with the ACE command.rarxphone_migrarlb who is also a rarx_phone admin. If a player runs it, the output still goes to the server console. Only one migration can run at a time.

How phones and numbers are matched#

  • With Config.Item.Owner = 'person', a rarx_phone line belongs to the character: rarx_phone_numbers(number, citizenid), and on boot the oldest line is used (ORDER BY created_at). The device identifier (rrxPhoneId in the item metadata) is only used for Face Unlock.
  • Each LB number is created in rarx_phone_numbers with its citizenid and an empty phone_id, not tied to any item. The player gets their line back with any phone (boot looks it up by citizenid), and it also appears in the physical store to recover it.
  • If a character had several phones in LB, all their numbers are migrated. The main line is the one in phone_last_phone (or the most recently used one). It is dated 2000-01-01 so rarx_phone picks it even if the character already had a test number.
  • Messages, calls and ads of the secondary numbers are moved to the main line, so they show as "mine" in rarx_phone.
  • If an LB number already belongs to another character in rarx_phone, it is left alone (conflict). That character gets a new number when the phone boots; their personal data (contacts, notes, photos...) is still migrated because it is keyed by citizenid.
  • LB Face Unlock is not migrated: in rarx_phone it is tied to the device (rarx_phone_face_enrollments) and is enabled again from Settings.

What is migrated#

Block LB rarx_phone Notes
numeros phone_phones, phone_last_phone rarx_phone_numbers Number, citizenid, device name.
ajustes phone_phones.settings rarx_phone_settings Wallpaper (custom URL, or cloud8 to "Cloud 8"; LB gallery wallpapers that rarx_phone does not have fall back to the default), light/dark/auto theme, brightness, do not disturb, airplane mode, streamer mode, 12-hour clock, hide number, setup completed. If the character already had rarx_phone settings, those are kept.
pin (separate) phone_phones.pin rarx_phone_settings.pin Not included in todo. LB stores the 4-digit PIN in plain text; rarx_phone accepts it and hashes it (scrypt) the first time the player uses it. Only migrated with ejecutar pin; otherwise phones have no PIN. A PIN in another format results in no PIN. Never overwrites an existing rarx_phone PIN.
contactos phone_phone_contacts, phone_phone_blocked_numbers rarx_phone_contacts First + last name, photo, email, address, favourite. No duplicates (one contact per character and number). Blocked numbers flag the contact or create a blocked one.
llamadas phone_phone_calls rarx_phone_calls One row per known side: outgoing for the caller, incoming for the callee; answered becomes done, otherwise missed; hidden number becomes oculto.
mensajes phone_message_channels, phone_message_members, phone_message_messages rarx_phone_convos, rarx_phone_convo_members, rarx_phone_messages Chats and groups (name, owner = admin, unread, deleted in LB = archived). Several LB chats between the same two characters (because of two numbers) are merged in date order; if the chat already existed in rarx_phone, messages are added there. Chats with a number that belongs to no player (services) become read-only system chats. Photos, videos, GIFs, payments (<!SENT-PAYMENT-...!> becomes a money message), locations and voice notes are converted to the rarx_phone format.
galeria phone_photos, phone_photo_albums, phone_photo_album_photos rarx_phone_gallery, rarx_phone_gallery_albums, rarx_phone_gallery_album_items URL, video, favourite, size and date. Shared albums become private albums of their owner.
notas phone_notes rarx_phone_notes Title, content and date.
correo phone_mail_accounts, phone_logged_in_accounts (app Mail), phone_mail_messages, phone_mail_deleted rarx_phone_mail_accounts, rarx_phone_mail The account goes to the character who had it logged in (active first). rarx_phone supports one account per character: if there were several, the active one is kept. Each mail is copied to the recipient's inbox and the sender's sent folder, except those each of them deleted. Action buttons are kept (requires migration 053). Addresses are kept as-is.
alarmas phone_clock_alarms rarx_phone_alarms Hour, minute, label, enabled; they ring every day (like LB).
buzon phone_phone_voicemail rarx_phone_voicemail Voicemails (marked as listened).
grabadora phone_voice_memos_recordings rarx_phone_memos Name, URL and duration.
mapa phone_maps_locations rarx_phone_map_places Saved places.
rrx phone_instagram_accounts, _posts, _comments, _likes, _follows, phone_logged_in_accounts (app Instagram) rarx_phone_rrx_accounts, _posts, _comments, _likes, _follows InstaPic to RRX. One account per character (the logged-in one, otherwise the most active). Posts with their photos and videos, comments, likes, followers, verified and private flags.
birdy phone_twitter_accounts, _tweets, _retweets, _likes, _follows, _follow_requests, phone_logged_in_accounts (app Twitter) rarx_phone_birdy_accounts, _posts, _likes, _follows, _requests, _hashtags, _sessions LB Birdy to rarx_phone Birdy (several accounts per character, like LB). Threads (reply_to / root_id), reposts, pinned post, hashtags, protected accounts, open session. If the rarx_phone Birdy tables do not exist, the block is skipped with a warning.
anuncios phone_yellow_pages_posts (Pages), phone_marketplace_posts rarx_phone_market_ads Title, text, price, photo (requires migration 030), date and number.
darkchat phone_darkchat_accounts, _channels, _members, _messages rarx_phone_dark_profiles, _rooms, _members, _messages Aliases, rooms, members and messages (including locations). Each room gets a new code; owner = first member. Room passwords are carried over when your rarx_phone database supports room passwords.
crypto phone_crypto rarx_phone_crypto_wallets Only coins configured in rarx_phone with the same id (Config.Crypto.Coins / Custom). Amounts are added to any existing balance. Requires migration 052_crypto.sql.

What is not migrated#

  • PIN, unless requested with pin. Face Unlock, because in rarx_phone it is tied to the device.
  • Account passwords (mail, Birdy, InstaPic).
  • Extra accounts of mail, InstaPic and DarkChat for the same character: rarx_phone supports one. The console lists them.
  • Direct messages from InstaPic and Birdy: RRX uses a different channel format and rarx_phone Birdy has no direct messages. The console reports how many there are.
  • InstaPic stories (they expire after 24 h), notifications and views.
  • Trendy (TikTok), Spark (Tinder), Music (playlists), Wallet (transactions), Services and LB backups: there is no direct equivalent or copying them makes no sense.
  • Missed call markers inside chats (<!CALL-NO-ANSWER!>): they are already in Recents.
  • Balances of coins that rarx_phone does not have (for example lbc): the console lists who had how much so you can compensate manually.
  • Photos, videos or recordings with URLs longer than 255 characters (they do not fit the rarx_phone column), and attachments with broken JSON and no text.
  • Group members whose number belongs to no player.

Console warnings worth checking#

  • Number format (see the steps above).
  • Old ads: rarx_phone only shows ads from the last Config.Ads.Days days (7). Migrated ads keep their date; raise that value if you want to see them.
  • Alarms above Config.Alarms.Max: they are not lost, but the player cannot create more until they delete some.
  • URLs from other domains: migrated media is shown as-is, but new uploads only accept the domains in Config.Messages.MediaHosts / Config.Fans.ImageHosts.

Repeat, undo and tracking#

  • rarx_phone_lb_import (bloque, origen, destino) records which LB row was copied and its id in rarx_phone. Running the command again only copies what is missing (for example, messages written in LB after the first pass).
  • Each block runs in one transaction: it is copied entirely or not at all. If a block's transaction fails, it is retried item by item and the console reports which items failed.
  • To undo, restore the backup you made before executing. The tool never deletes anything.