I changed the folder of where my NextCloud files is and got this error.
Adding the “.ocdata” dummy file there doesn’t work. The message is cryptic. I tried to run occ at the root folder (hoping it’s some sort of management tool) by running this at the command/SSH prompt:
php ./occ
and it spits out:
Your data directory is invalid
Ensure there is a file called ".ocdata" in the root of the data directory.
An unhandled exception has been thrown:
Exception: Environment not properly prepared. in
{New Folder}/lib/private/Console/Application.php:168
Stack trace:
#0 {New Folder}/console.php(99): ...
I replaced my actual path for the new location of the NextCloud files with {New Folder}, so you get the idea.
I also noticed the old path was regenerated with just a /data folder with two files
This means some programmer got lazy and hard-coded the path somewhere!
Line 99 of console.php didn’t give too much hint so I looked at the code around for some sort of config-related operations before. Then I noticed this:
So I searched for config.php and found it’s located in /config/config.php. Bingo!
And to my horror the SQL password is stored in plain text in config.php! WTF! I’ll choose a password that’s dedicated to one use and not shared!
I recalled a when I rename WordPress databases, I have to manually edit the changes in wp-config.php. Turns out nobody warned us about that for NextCloud! That config file also contain database settings, so I bet if I change the database names or database usernames, I’ll have to come back and edit it manually too.
The site is working after I made the migration changes, all in /config/config.php.
My web hosting package comes with cPanel email, which comes with Calendar/Tasks (CalDAV) and Contact list (CardDAV) in one convenient package.
Default setup often causes a few user experience problem
Special storage folders not working (hint: path incorrect)
Sent email not saved in ‘Sent’ folder
Turns out that every ISP has their own IMAP folder structure. My ISP structured everything, from system special folders (Sent, Drafts, Trash, Spam) to user-defined folder, into subfolders under Inbox.
So the settings in Windows Live Mail should be:
DO NOT FORGET to set the root folder Inbox! Subfolders are internally accessed as Inbox.Sent, Inbox.Drafts, etc. Using DOT (.) as seperator! Do not use slash like Gmail. It doesn’t work!
If you specify the “Root folder path” and have the special folders relative to that, the Windows Live Mail client will show a flat layout (Just like the webmail client):
Alternatively, I tried entering the special folders’s full path individually one by one
but I’m pleased to see that doing so VISUALLY placed ALL folders (system or use-created) into a nice tree structure that follows its native structure!
Having a root folder “Inbox” implied a prefix “Inbox.” (with the dot at the end) to all special folders path. Again, slash do not work as it’s not Gmail. The separator is dot in cPanel.
Seems like the whether ‘Root folder path‘ is specified determines if the folders are flattened or have the native tree structure in Windows Live Mail’s display.
Special folders settings can be invalid, which the Windows Live Mail Client will quietly ignore them and operate in local storage folders instead.
How did I discovered it? I saw the tool-tip INBOX.sent when I hover over the ‘Sent’ folder in Horder WebMail.
Many years ago, Gmail changed their folder structure so some of the IMAP settings tutorials are not correct anymore. Since Windows Live Mail (WLM) auto-configures Gmail, the special folders are automatically determined and they cannot be specified. Please leave Root folder path alone like this:
Basically Gmail decided with the exception of Inbox, which stays at root, all “System labels” goes under the subfolder [Gmail]. However user-created labels (simply called “Labels“) stay at root folder level. For example, I have a user folder called Save enabled for IMAP, the folder tree with the Gmail account looks like this:
Because you cannot specify where the Trash folder is, delete button really mean delete (to a recycle bin that’s purged in 30 days), not archive to a folder.
Also because Gmail is smart enough to save a copy in your [Gmail]/Sent Mail folder if you use their SMTP (out-going mail) server, the “Save copy of sent message in ‘Sent Items’ folder” setting on Windows Live Mail is irrelevant: you cannot choose not to save it.
And yes, I tried it checking this (for other non-Gmail accounts), and confirmed that Gmail is smart enough to save one copy (not one from the SMTP and one executed by the client).
So here’s a summary:
Gmail automatically configures and dictates IMAP’s special folders. You have no choice
No special folder choice means you cannot reroute ‘delete’ to mean archive/move
If you use Gmail’s SMTP server (likely), it will save a copy of outgoing mail to [Gmail]/Sent Mail folder. You cannot turn this off.
“Save copy of sent message in the ‘Sent Items’ folder‘ is irrelevant if you use Gmail’s SMTP server. It will correctly save only one copy of the sent mail.
One thing that 2020 and 2021 taught us is that we’ve foolishly surrendered our data to private companies for harvesting and subjected ourselves to being manipulated (behavior conditioned) by bots (artificial intelligence studying our habits), in exchange for a little convenience having big companies hosting our data (on the cloud) for free.
The conventional wisdom is that something is free without the pains (either hard to use or has advertisement), you are the product to be monetized.
Their house, their rules.
They are the ones who wrote the law, interpret the law, and enforce the laws. The unholy trinity has fused the 3 traditionally separated powers in democracies and became THE almighty.
Of course they bear the consequence of their actions, depending on how much de facto leverage they actually have, which is increases with their size. They are already effectively controlling the government with their extensive lobbying budgets.
Not to mention that we are also rely on their IT security department that are constantly under attack since a centralized target provides a high return on investment in hacking attempts. Bad people only need to hack a big corporation once to steal 100 million+ user data. If the 100 million+ users’ data are scattered on many different servers with different software, configurations and locations, each attack will be much less worthwhile.
In some sense, it’s much safer for less attractive targets (nobodies) to risk security flaws in their own setups because nobody cared to go after them. More importantly, I don’t want to feed a monster with my data that they are going to bite me or other people I support whenever they wanted to.
Here are the basic minimum web services that we’ve become reliant on in our daily lives.
Email
Calendar & Tasks
Contact List (e.g. Phonebook)
In Google ecosystem:
Gmail
Google Calendar & Google Tasks
Google Contacts
Apple (iCloud) uses the standard protocols
Email: IMAP/SMTP
Calendar & Tasks: CalDav
Contact List: CardDav
If you are paranoid about full control over your data that nobody (including tech support) can see, you should host your own server (based on the protocols above). But if you are concerned about up-time, these services come pretty standard with most cheap (shared) web hosting plans at around $2/mo.
If your provider uses cPanel (e.g. namecheap), each email account comes with Calendar/Task (CalDav) and Contact List (CardDav) sync services. They typically come with a webmail client like horde/roundcube.
Namecheap has their own dedicated email service, but I think their shared hosting plan is a much better deal unless you really need the ActiveSync (Outlook, but you can do it for free with CalDAVsynchronizer) and the Open-Xchange productivity suite (which looked better than horde webmail client). You can also host websites and WordPress (blogs) with the hosting plan and have a FTP server for your files.
cPanel is the most popular admin panel for shared hosting, but there are companies like Dreamhost that doesn’t use cPanel and do not offer calendar/task and contact sync services natively so watch out.
In Android, I recommend the following setup after trial and error
CalDAV/CardDAV sync adapters (needed for Calendar & Contacts above): DavX5
These are ALL open-source free software (privacy respecting) available from F-droid.org, which do not require login/purchases (please donate). You might see the paid version on Play Store, but it’s just taxing the less adventurous people.
Many fancy email apps that autoconfigures the server for you often harvest your data or do analytics. Be very careful of that. As far as I know FairEmail is the only one that has advanced features comparable to Gmail and doesn’t harvest your data nor charge you.
Remember to turn on Push-IMAP in your email client so it’ll be as responsive as Gmail. In Fairmail, it’s under Settings -> Receive -> When -> Automatically Optimize ON + Always.
I’ve tried a few other Calendar and Tasks app on Google store (such as BusinessCalendar and aCal), and so far the stock Calendar app and Simple Calendar Pro’s built in refresh works correctly with DavX5 sync adapters. The refresh button for the rest did nothing so I had to open DavX5 to manually initiate a refresh if I don’t want to wait 15 minutes (fastest update rate allowed by DavX5).
As for Tasks.org app, it doesn’t use the sync adapter. Instead we directly enter the CalDAV login info with the server link provided by your hosting provider