Alfresco conent store deletion - alfresco

I have conentstore configured in below content store location.
D:\alfresco-content-services\alf_data\contentstore**2019**
I want to delete above shown 2019 folder under conentstore. I dont need 2019 anymore. Basically purging .
If i delete files above folder ,will it clean-up the metadata and indexes also ?
or will it corrupt my respository ? Whats the best way to achive mass deletion , which will delete references in database also without corrupting repo ?
Thanks & Regards
Brijesh

If you delete any folder from the content store, it will not affect the database (and hence the indexes) in any way. You will end up with nodes referencing .bin files that do not exist anymore, though.
Note, if that folder is the first year in your content store, then it also contains some files used by Alfresco to determine if the content store matches the database. Depending on this, if you delete the folder - you will mess up Alfresco (repository will not start if it does not find those files).
Mass deletion in general is tricky, I'd suggest using Bulk Import Tool's delete web script that does this as fast as possible (avoids audit logs, recycle bin, etc).

Related

Save profiles / files Alfresco

I want to uninstall Alfresco and re-install again, but I don't want to loose the accounts created in Alfresco and the other things. Is there any way to save this ?
Thanks!!
Let's assume that by re-installing you mean you want to start with a clean alfresco WAR and share WAR. If so, you can just shut down, remove the alfresco and share directories, then place the clean WARs in the $TOMCAT_HOME/webapps directory. If you had any AMPs deployed, use MMT to re-install those. Then, restart Tomcat. The content is in the content store directory and the metadata is in the database, so you can start over with fresh WARs without losing any data.
If you mean you want to delete everything in $ALFRESCO_HOME but you want to save your data, the easiest thing to do is to dump your database and tar up your content store. Then you can completely blow away your installation, and after reinstalling, you can load your database and un-tar your content store.
If you are trying to blow away some, but not all of your data, you'll have to export what you want to keep. You might go look at the docs on ACP files as one possible approach. Or you could use something like CMIS to write an exporter.
For users, specifically, it is often helpful to use an LDAP directory instead of managing them in Alfresco directly. That way you can completely start over and Alfresco will simply synchronize your users from LDAP.
If you don't want to use LDAP an alternative is to have a simple CSV file with user account data. After starting your repository for the first time you can re-import your users from the CSV file.

Should we store data in database?

i'm asp.net beginner and currently working in "upload download file" project with asp.net and vb.net as code behind language (like skydrive's web).
what i'm want ask is about upload file in server, must we store path file, size, accessed or created date into database? as we know we can use directory listing in system.io.
Thanks for your help.
You definetly want to store the path of the file. You want a way to find the file ;) Maybe later you will have multiple servers, replication or other fancy things.
For the rest, it depends a bit on the type of website. If it's going to get high traffic then store it in the database, this will limit the number of IO call (very slow). Also, it'll be a lot easier to handle sorting and queries. (sort by date, pull only the read onyl files, ...).
Database will also help if you want to show history or statistique.
You can save file in some directory and can save path of that file in database. You can also store size and created date of that file in DB. But storing a file in DB is a bit difficult. Rather than save file in Directory and save path of that file in DB
you could store the file information in a database to built some extra features like "avoid storing duplicate files", because you are having a faster search in the database! if you search the filesystem always a recursive function call get started

How to manage multiple alfresco repositories?

Problem description:
I have multiple alfresco installations (development, testing, production) of one project.
I need to copy files under Data Dictionary folder (Scripts, Templates, Web Scripts) from one to another in one direction (development -> testing -> production).
Current solution:
I copy files manually via webdav, which is annoying and unreliable (I can forget to copy some.).
Desired solution:
I'd like to have I tool, which will copy changed files at my command, what they are ready for the next step. I had an idea, that it could internally use a Git repository with branches for each installation, being able to fetch the files from devel and push the files to testing and production. This way (with Git) it could also support reverting changes.
It looks like a quite common problem, but I wasn't able to google something about it, so I'm asking here. Does such a tool exist or is there a better way of managing multiple repositories?
If you have a brand new installation of your development/testing/production Alfresco instances, you could simply migrate alf_data dir content, that contains by default db, indexes, content-store, backup files. If you need, you could migrate the "shared" folder too, or at least some files from the shared folder as could be some Alfresco customization (custom scripts or similar). Here is the link that helps with migration steps:
http://wiki.alfresco.com/wiki/System_Migration
Otherwise, if you need only to move a folder from Data Dictionary, or a set of documents, you could use ACP in order to achieve that. Here is the wiki for doing this: http://wiki.alfresco.com/wiki/Export_and_Import
You could do this via FTP. When your want to deploy new changes, you can go with manual client like FileZila to download changes from Dev, then upload them to test.
But you can also automate FTP, so that it can run a scheduled check if there are new things on, say, dev and push them to test.
If you use Git for source control, you could also do this via git-ftp. Hold a copy of Data Dictionary in your source folder, then add some sort of pre-commit check, which will see if you changed any of those files. If you did, on commit it will push the change to dev and test.
I think Relication service AF is suitable for you.
http://wiki.alfresco.com/wiki/Alfresco_Community_3.4.a#Replication

Moving Raw MYSQL Data Files to a Different Directory

I have a directory only backup of a previous server that hosted multiple sites. I had access to a few .sql backups for our databases, but there were some that had not been backed up in that fashion. I located the .MYD,.frm, and .MYI files for the tables in my db in the var/lib/mysql/db_name directory.
I would like to know if there is a way to get the data from these files and move them into the new existing mysql installation? I tried copying the files from the db folder to a db folder with the exact same name, but I still get a "Can't find db_name/table_name.frm" error when trying to access any of the tables. They do show up in phpmyadmin table list, the error comes up when trying to access the tables.
Is this possible? If so, how do I go about taking these table files and turning them into use-able data?
I am sorry if my question or explanation doesn't make any sense. This is part of an ongoing 11+ hour emergency server recovery project that got sprung on me today, so my brain is fried. I will answer any questions necessary.
Have you checked that the files in /var/lib/mysql/db_name/ are owned by mysql and not root? Usually copying the files in should 'just work' (certainly it has and does for me). I assume you're using the same or very similar version of MySQL?
You really need to restore everything relating to that database, including also the matching 'mysql' database for your previous installation.

issue in deleting when we have more than 1 file

i have 10 files. i want to delete them but the condition here is
as i delete file 1 to file 5 .let say in file6 i got an exception then in that case i should restore all the files deleted
i should delete the files only if there is no exception occured in any of the file when we try to delete
something like rollback transcation what we do in DB. is there any properties in file we can achive this concept
anyhelp would be great thank you
You could do this in two phases. First, rename all the files (or more them). Then, once you're happy that all the files are deletable you can go and really delete them. If not, then you rename them back (or move them back) to their original state.
The actual deletion could happen as a batch job as well.
If transactional NTFS doesn't work out for you, you could take the route of copying all the files to a temp location before deleting... then catch any exceptions. If there are exceptions, check to see if each file exists, and if not just copy back any that are missing from the temp location.
If the files don't tend to be too large, you could also consider storing the files in a relational database where you get that kind of transactional support and more.
You can have a look at Transactional NTFS which does what you want it to. I've not tried it myself but here is a link to use it in .net
http://code.msdn.microsoft.com/txfmanaged

Resources