🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #265538

Re: DIALOG settings.ini identity syntax section locations

#265538
From: Bernd Rose
Date: Sat, 30 Apr 2022 12:44
154 lines
9090 bytes
On Sat, 30th Apr 2022 12:22:57 +0200, wasbit wrote:

>> If I understand correctly, you recreate everything from scratch? (Instead
>> of restoring a current backup.) 
> 
> Not really. I make a full backup periodically because corruptions are
> frequent enough and you never know what got corrupted.
> 
> But I only pull out of that full backup the few files that are required for
> customizations to be recreated (such as a dictionary file).
> 
> But if there's a better method to recover from corruptions, I'll learn it.

40tude Dialog is completely self-contained. Some user scripts have been
relying on absolute paths and therefore would need adjustment. Apart from
this, the whole Dialog directory could be copied to whatever location 
(even USB thumb drives) and successfully run from there.

That said, Dialog /must not/ be installed or copied into an UAC protected 
folder, like "C:\Program Files\". (It is possible to do so, but requires
detailed manual adjustments.) A folder like C:\Portable\ would be okay.

Because of its portability, you can restore Dialog from a backup copy by
simply deleting or renaming the folder of the defect installation and
copying the backup folder with its subfolders to the old and new location.
Do not mix parts of a backup into either a fresh or faulty installation
or into a restored backup from another time! Although most files will not
be problematic, settings.ini might and the whole content of the "data"
subfolder /will/ result in faulty internal references.

> data contains most of the changes over time 

Data contains the whole Dialog group and article database. It /of course/ 
changes continuously over time. CompactDatabase can be used to clear the
folder of deleted content. (Deleting a message inside Dialog just sets an
internal marker in the database, but does not really delete anything.) 
If you encounter problems with articles in a certain group, you can delete
all articles, unsubscribe and run a CompactDatabase. Afterwards you can
re-subscribe and call SampleHeadersFormGroup (Online menu) to refill the
group from server. I never had the necessity to do so since the beginning,
though.

> and settings.ini can get corrupted (which was my most recent corruption).

Never had this, either. The only situation, where settings.ini is likely
to get corrupted is by installing Dialog in an UAC protected folder. In
such a case (if the setup did not receive certain manual adjustments), two
settings.ini exist and sometimes cancel each other out. (Reading from one,
writing to the other.) One settings.ini would be the one of the Dialog
folder. The other resides in the VirtualStore inside the "C:\Users" tree.

>> For the data folder, keep the backups (at least the latest) after running
>> CompactDatabase.
> 
> I don't really know how compacting affects being able to copy back at a
> later date.

You /never/ *mix* the content of 2 "data" folders. Delete or rename the
one to be replaced and copy the other from backup. It doesn't matter, if
the backup has another CompactDatabase state. The various internal pointers 
are self-contained inside "data". You just get an uncompacted state when
restoring a copy of "data" created before (or by) CompactDatabase. Run
CompactDatabase (again), and the database will (again) become smaller.

By restoring an older version of "data" you (of course) loose all changes
to the database that took place after creating the backup. But even if you
are tempted to save some of these losses by mixing the backup with the most 
recent version of data (corrupted or not). Do /not/ give in! The probability
of the database /not/ getting corrupted this way is small. (Although any
problems might manifest themselves much later.)
 
> Therefore I'm afraid to compact because I don't know if that makes it
> compatible or not but the real problem with copying back the entire data
> directory is I don't know which files got corrupted and they may be one of
> those data files that I don't need to copy over. 

If a CompactDatabase runs successfully, the database should be intact.
(At least intact enough to be used.) Therefore, either the backup of the
uncompacted "data_oldXX" folder or a fresh backup copy of the compacted 
"data" folder should be usable in later emergencies.

If only a certain group has problems, use the selective cleanup process 
described above.

Be sure to also save everything else (not only the "data" subfolder), 
whenever you add/change a server, an identity or the like. Otherwise
you'd loose access to those parts of the database.

> How does compacting help in terms of copying back files later?

Apart from keeping the backup small, Dialog is not meant to be used as
archive for huge amounts of messages. (Use Hamster or any other local
Usenet news server for such a requirement.) The more messages are stored 
inside the Dialog database (deleted or not), the longer takes each lookup.
Long lookups increase the risk of sth. interfering, like an AV program
suspicious of the long read time or certain database contents, a power
outage, or any other reason.

Please note, CompactDatabase does not /compress/ the database files in 
any way. It just removes deleted messages from storage and reorders the
database structure according to your subscribed servers and groups.

> But what if the settings.ini file is what got corrupted?

UAC problems with 2 different settings.ini (see above) aside: If Dialog 
worked well before closing, and it did not crash while closing, then your
settings.ini should be okay to backup. (And to be restore later on, if 
need should be.)

If you want to err on the cautious side: Keep /several/ backups from
different times. Just be sure, these backups match your current server
and identity settings. Otherwise any current or backup "data" folder 
will not match.

>>> As the last step of repopulating Dialog if I create an equal number of
>>> dummy identities inside the Dialog GUI
>> 
>> This step should have also created the correct setting of IdentitiesCount 
>> inside the [General] section.
> 
> I realized my mistake in concluding wrongly that the POSITION of the
> identities mattered. It wasn't the position after all. It was that I was
> unaware of the GENERAL section in settings.ini which required a manual
> setting of the number of identities. That was all my fault. 

IdentitiesCount should never be set /manually/. You either restore a
complete settings.ini matching the current "data" subfolder. Then the
IdentitiesCount and the identities themselves (aka their count as well 
as their names) contained inside settings.ini should be okay. Or you
create new identities inside the GUI. This step not only writes values
into settings.ini, but also creates files and entries inside files in
the "data" folder. Both are linked by the /name/ fields of each identity.
Defining or altering an identity name, therefore, is /only/ possible in 
the GUI.

[Pointers from settings.ini into data]
> I don't understand anything in that paragraph because I don't see any
> folders that have anything to do with any identity (or even the number of
> identities). 

The pointers are not human-readable. The names of the identities appear
somewhere inside the file of the whole list of (news)groups and folders
(= groups.stg). The position in this file is a pointer to the next files,
where they are linked to (arbitrary) numbers, that link to the numbered
database files. Within these files are other numbers, that point into
the files containing any messages from and to these identities.

Conclusion: Never mess with single files, but backup the whole Dialog
folder and all its subfolders. From "data" subfolder you can backup
later copies (= always the /whole/ subfolder), as long as you didn't
alter anything from server settings to identities. If you did, create
a new backup containing everything.

Bernd
Technical Details
Message-ID: <4e3uhxg2tbf6$.dlg@b.rose.tmpbox.news.arcor.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <t4enug$5vf$1@dont-email.me> <jj9ur27pmzkh.dlg@b.rose.tmpbox.news.arcor.de> <t4hrjd$7ri$1@dont-email.me> <11kgreixfjb9q$.dlg@b.rose.tmpbox.news.arcor.de> <t4j2lf$1kg$1@dont-email.me>

Show Full Headers
Complete Article Headers
Message-ID: <4e3uhxg2tbf6$.dlg@b.rose.tmpbox.news.arcor.de>
Subject: Re: DIALOG settings.ini identity syntax section locations
Date: Sat, 30 Apr 2022 14:44:37 +0200
From: Bernd Rose <b.rose.tmpbox@arcor.de>
References: <t4enug$5vf$1@dont-email.me> <jj9ur27pmzkh.dlg@b.rose.tmpbox.news.arcor.de> <t4hrjd$7ri$1@dont-email.me> <11kgreixfjb9q$.dlg@b.rose.tmpbox.news.arcor.de> <t4j2lf$1kg$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.readers
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: solani.org; logging-data="1753158"; mail-complaints-to="abuse@news.solani.org"
User-Agent: 40tude_Dialog/2.0.15.41 (0a5fc4f7.65.293)
Cancel-Lock: sha1:NgJ4a6I4+uWImhOdz/c4gNeoLlk=
X-User-Id: eJwFwYEBwCAIA7CXVkaLnoO4/n/CEr6CplJU0rRxsvVFOy+tU4/hJ9hQdphduHsfbDpnzQohv+RaMxDRJuuEBoh7XPED3DcZvQ==