Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

If your DualShield is using a Microsoft SQL database, please follow the steps below.

1 - Login to MS-SQL Studio

2 - Right click the DualShield database. By default it is named as "DualShield"

3 - Select "Tasks | Import Data"

Image Removed

4 - 

Image Removed

Image Removed

Image Removed

Image Removed

Image Removed

Image Removed

Image Removed

Image Removed

Image Removed

Image Removed

Image Removed

1 - Create a data-format file, name it with the file extension ".fmt", e.g. DB3.FMT. Copy the content below to the file:

Code Block
languagesql
10.0
7
1 SQLCHAR 0 1 "\"" 0 first_double_quote  Latin1_General_CI_AI
2 SQLCHAR 0 20 "\",\"" 5 ip_from ""
3 SQLCHAR 0 20 "\",\"" 6 ip_to ""
4 SQLCHAR 0 255 "\",\"" 3 country_code Latin1_General_CI_AI
5 SQLCHAR 0 255 "\",\"" 4 country_name Latin1_General_CI_AI
6 SQLCHAR 0 255 "\",\"" 7 region_name Latin1_General_CI_AI
7 SQLCHAR 0 255 "\"\r\n" 2 city_name Latin1_General_CI_AI

Image Removed

*Make sure that there is a carriage return after the last row.

2 - Log into the MS-SQL studio

3 - Change to the DualShield database

4 - Execute the script below to import the database

Code Block
languagesql
BULK INSERT [dualshield_database_name].[dbo].[ip2location_db3_ipv6]
    FROM 'FILE-PATH-TO\IP2LOCATION-LITE-DB3.IPV6.CSV'
    WITH
    (
        FORMATFILE = 'FILE-PATH-TO\DB3.FMT'
    )
GO

* replace "dualshield_database_name" with the name of the DualShield database. By default, it is "DualShield"

* replace "FILE-PATH-TO" with the actual file path where the downloaded file is saved, e.g. "c:\downloads"

Image Removed

Please note that it can take about 30 minutes to import the data.

Table of Contents

Prepare Data

- Open the CSV file "IP2LOCATION-LITE-DB3.IPV6.CSV" in a text editor

Image Added

- Add the header row below in the CSV

ip_from,ip_to,country_code,country_name,region_name,city_name

Image Added

- Save the file

Install DBeaver

Unfortunately, the MS-SQL Studio cannot import the IPV6 data into the MS-SQL database! You need to use a tool called DBeaver.

Download and install DBeaver Community Edition from the link below:

https://dbeaver.io/download/

Image Added

Import Data

- Login to DBeaver console

- Navigate to the DualShield database. By default it is named as "DualShield"

- Locate the table called "ip2location_db3_ipv6"

Image Added

- Right click the table "ip2location_db3_ipv6"

Image Added

- Select "Import Data"

Image Added

- Select "CSV" in the Target list

Image Added

- Select "IP2LOCATION-LITE-DB3.IPV6.CSV" in the Source pane

Image Added

- Keep the default settings.

- Click Next

Image Added

- Select "skip" in the "id" mapping.

- Click Next

Image Added

- Click Start to start importing the data

- Please note that it can take hours to import the data dpending on the performance of the machine, as there are nearly 5 millions of records to be imported.

Process Data

5 - After the data has been successfully imported, execute the script below

Code Block
languagesql
update ip2location_db3_ipv6 set
ip_from = (SUBSTRING(REPLICATE('0', 39), 1, 39 - LEN(ip_from)) + ip_from),
ip_to = (SUBSTRING(REPLICATE('0', 39), 1, 39 - LEN(ip_to)) + ip_to);

**********

Image Removed

Image Removed

Image Removed

Image Removed

Image Removed

Image Removed


Image Added

Image Added

Image AddedImage Removed